Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

IAP problem in 2017.2

Discussion in 'Unity Build Automation' started by chatpongs, Nov 18, 2017.

  1. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Unity IAP stopped working for my projects in Cloud Build after updated to 2017.2. It was like some C# scripts such as IAPButton.cs were missing from the project even they are checked in.

    I tried to find the problem by making a simple project with only Unity IAP imported, and found out that the scripts that have "#if UNITY_PURCHASING" didn't work. The workaround at this moment are either
    • remove all "#if UNITY_PURCHASING" from the project
    • go back to build with 2017.0 or .1
    Just wonder if anyone having this problem too?
     
  2. Banky

    Banky

    Joined:
    Sep 10, 2014
    Posts:
    24
    Same here. Unity IAP stopped working for me after updated to 2017.2.
     
  3. chatpongs

    chatpongs

    Joined:
    Mar 2, 2015
    Posts:
    24
    Have you try removing all #if UNITY_PURCHASING? I think it is the only workaround at this moment
     
  4. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    Same for me. Not tried removing UNITY_PURCHASING - worth a shot though.... I'll let you know if I have any success
     
  5. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    Tried this and still get the same issue...
     
  6. GreenBee

    GreenBee

    Joined:
    May 6, 2017
    Posts:
    4
    Great! Same here. What now, you switch version ?
     
  7. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    I managed to sort this by setting up a define in cloud to UNITY_PURCHASING and it worked for iOS. Not worked for Android, but I don't know if that's something else causing the issue, as I use Gradle and proguard but have never been able to test these on Cloud.

    So to add the define, go to your project, and select Config then go to Advanced Options, then hit Edit. From here, you can add in defines specifically to that config. I've done it to both my iOS and Android configs and I no longer get this error.

    Not sure who's 'fault' this one is (Cloud or IAP), but I will say that I have had to disable/re-enable IAP inside 2017.2 to get the define to work, so maybe its a broader issue with 2017.2
     
  8. visualbruno

    visualbruno

    Joined:
    Jan 2, 2015
    Posts:
    102
    Thanks for the trick.

    It worked for me on Android.

    upload_2017-12-13_13-42-58.png
     
    alan_motionlab likes this.