Search Issue Tracker
Won't Fix
Votes
1
Found in
2018.4
2019.4
2019.4.17f1
2020.2
2021.1
2021.2
Issue ID
1310277
Regression
No
Asmdef Script not compiled with UNITY_PURCHASING define when launching Editor after deleting Library folder
How to reproduce:
1. Open the attached project "case_1310277-Project.zip"
2. Run the test Scripts (Test->RunTest)
3. Inspect the Console Window
4. Observe that both the asmdef Script and the non-asmdef Script uses the UNITY_PURCHASING define
5. Close the project
6. Delete the Library folder in the project's directory
7. Open the project again
8. Run the test Scripts again
Expected result: Both the asmdef Script and the non-asmdef Script uses the UNITY_PURCHASING define
Actual result: Only the non-asmdef Script uses the UNITY_PURCHASING define
Reproducible with: 2018.4.32f1, 2019.4.21f1, 2020.2.7f1, 2021.1.0b9, 2021.2.0a7
Notes:
- With Unity 2021.1.0b9, 2021.2.0a7 versions, both the asmdef, and non-asmdef Scripts are not compiled with UNITY_PURCHASING, however, the Assemblies (Plugins folder) are imported in the Package itself rather than in the Assets folder instead
- In-App Purchasing must be set up through the Services tab when opening the project on another account
Workaround: Triggering a Script recompile fixes the issue (doesn't help with Unity 2021.1.0b9, 2021.2.0a7)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
Resolution Note (2021.2.X):
The IAP team has stopped including the #define for ‘UNITY_PURCHASING’ in the Unity Editor.
In certain older versions it was included when the IAP Services was turned “On”. Unity IAP required installation of two packages, previously. When only one piece was missing, developers would experience broken projects.
This is no longer true. However the Unity IAP documentation however does not reflect that, today.
To restore support for the 'UNITY_PURCHASING' symbol in a project, the ASMDEF solution described here, and also adding it to the Player settings' Scripting Define Symbols both can work.