Search Issue Tracker

Fixed in 2.2.1



Found in [Package]





Issue ID




UNITY_PURCHASING define becomes disabled when recompiling assemblies

Package: Purchasing


Steps to reproduce:
1. Open User-supplied project ("Change IAP setting from")
2. Enable IAP in Services
3. Press Commands (at the top) -> Write UnityConnectSettings (This reads the UnityConnectSettings.asset file and writes it back EXACTLY as it was. It will print to the console.)
4. Open Assets -> Editor -> Commands.cs
5. Make Changes to the script (for example comment out [MenuItem("Commands/Dummy!")])
6. Return to Unity and inspect the Console window

Expected: Nothing appears after a recompile
Actual: "Assets\Editor\Commands.cs(6,10): warning CS1030: #warning: 'UNITY_PURCHASING is disabled! (but is it really...?)'" appears, indicating that

Reproduced in: 2018.3.0a1, 2018.3.10f1, 2019.1.0b8, 2019.2.0a9
Not reproduced in: 2017.4.24f1

  1. Response avatar

    Resolution Note (fix version 2.2.1):

    Seems to be fixed with the recent releases of IAP: Package Manager 2.2.1 and Asset Store 2.2.4.

Comments (2)

  1. 89e04f03f8945c51e98949198a23fa37?d=mm


    Jun 19, 2020 13:31

    This issue is really frustrating! We have lost dozens of hours working around this in our custom build pipeline (it now involves restarting Unity twice before AND after a build for a certain platform, to guarantee that all assemblies see the correct state of the IAP system) and we STILL encounter it in other random situations where we don't even touch the setting.

    We _try_ to counter it by forcing assembly reloads from code (by adding a new define symbol and then removing it) but our process needs to write to a file what we were doing so that we can read it and return to that after the compilation finishes. It's REALLY terrible.

  2. Df557eb53b1b13754442ceae9bda1ea0?d=mm


    Jul 20, 2019 01:10

    Is there a work around for this issue? I collaborated from PC to MAC and the Mac version doesn't seem to have a definition for the UNITY_PURCHASING Directive.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.