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
- SystemInfo.get_graphicsDeviceName() is generating garbage GC Alloc when using Metal graphics API
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
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.