Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice

IAP fails in Unity Cloud Builds

Discussion in 'Unity Cloud Build' started by alan-lawrance, Dec 18, 2020.

  1. alan-lawrance

    alan-lawrance

    Joined:
    Feb 1, 2013
    Posts:
    299
    Unity: 2018.4.30
    IAP Package: 2.0.6

    Build local, deploy to Google Play Games, and IAP works as expected.

    Exact same repo, built using Unity Cloud Build, deploy to Google Play Games, IAP fails. Appears to be exception in the InitializePurchasing boilerplate on this line:

    var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());

    Seems to have been some discussion of IAP and Unity Cloud Build issues years ago, and I tried the suggestions I found:

    1. define UNITY_PURCHASING
    2. re-import IAP package
    3. Disable then Re-enable IAP

    But same results.

    It seems this must be a build problem with Unity Cloud Build and IAP, or I've configured something incorrectly. Everything else works on the Unity Cloud Build version, such as logging into Google Play Games.

    The work-around is to just make the build locally, but this messes up the automation process we have. Would really like to get to the bottom of this.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    10,337
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    10,337
  4. alan-lawrance

    alan-lawrance

    Joined:
    Feb 1, 2013
    Posts:
    299
    The problem resolved after I updated the IAP package from 2.0.6 (which is the verified package for 2018.4) to the latest 2.2.1. My best guess is that 2.2.5 Plugin depends on 2.2.1 being installed, but for some reason building local wasn't problematic with 2.0.6 (maybe importing the 2.2.5 plugin did something sneaky).

    To sum up: If you are using 2018.4, make sure you use 2.2.1 of the package if you are using 2.2.5 plugin. It sounds like the plugin and package are going to be merged in the future, which definitely sounds like a good idea.
     
unityunity