Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 2020.2.1f1: Codeless IAP Buttons reset every time I open any project

Discussion in 'Unity IAP' started by Toastbyte, Jan 15, 2021.

  1. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    51
    Hello world,

    I recently updated to Unity 2020.2.1f1. Now all the projects that used the codeless IAP feature before, have an issue with loading the IAP button preferences.

    Every time I open a project, the following warning shows in the console and I have to REINSTALL the unity purchasing package and manually reset all IAP buttons.

    2.jpg

    This is what the IAP button should look like in the editor:
    upload_2021-1-15_15-40-18.png

    This is what the IAP button looks like after opening the project:
    upload_2021-1-15_15-32-0.png

    I checked and the the referenced script (UnityEngine.Purchasing.IAPButton) on this Behaviour is actually NOT missing! As far as I know, all associated IAP files still are in their directories.
    This is the referenced "IAPButton" script that shows up normally in the folder:
    upload_2021-1-15_15-35-10.png

    I also discovered that when reinstalling the unity purchasing package, then revert to an older version of the project through unity collaborate, and then revert back to the new one, the preferences are back. However, it would be very nice if I didn't have to do that every time I opened my projects using unity IAP.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you using Collaborate? Please compare to a local-only project. It appears we lose that reference if the /Library folder is not sync'd as when using source control, which would be a bug. We plan to address this in the April/May timeframe with IAP 3.0 where we are going to a single Package Manager component.
     
  3. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    I've been having this problem as well. How should we fix it until you get around to it in April/May?!
     
  4. Toastbyte

    Toastbyte

    Joined:
    Sep 1, 2016
    Posts:
    51
    Yes, I am using collaborate. This is probably the issue.

    I guess until then we will have to reset the IAP preferences ourselves by reinstalling the IAP package and reassigning the IAP buttons manually
     
  5. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    Could you please tell us exactly where in the Library folder we should add syncing across source control so we can prevent this issue? Using the entire folder seems like overkill so it'd be nice if we could have a description of what to sync. This issue is honestly giving me headaches every single day because I develop across a few different branches and platforms, between IAP-supported mobile and non-IAP-supported-desktop, so it's driving me nuts.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please add UNITY_PURCHASING as a custom script define in Player Settings/Other Settings. This internal define goes missing in some cases and results in the errors that you are seeing, and adding it manually should resolve the issue. It's due to script compilation order, and should go away when we move to an all Package Manager version of IAP soon that doesn't require the define.
     
    Last edited: Feb 1, 2021
    MayhemMike and Toastbyte like this.