Search Unity

[Solved] Exception on UnityIAP Android when moving to 1.6

Discussion in 'Unity IAP' started by Nicolas1212, Jul 15, 2016.

Thread Status:
Not open for further replies.
  1. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    This morning I updated the UnityIAP plugin from 1.5 to 1.6 through the Services tab.

    I built an APK (nothing else has changed), and now when I initiate a purchase, I get the following exception:

    AndroidJavaException: java.lang.IllegalArgumentException: Receiver not registered: com.unity.purchasing.googleplay.GooglePlayPurchasing$3@2c9eca64: java.lang.IllegalArgumentException: Receiver not registered: com.unity.purchasing.googleplay.GooglePlayPurchasing$3@2c9eca64
    android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:871)
    android.app.ContextImpl.unregisterReceiver(ContextImpl.java:2103)
    android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:529)
    com.unity.purchasing.googleplay.GooglePlayPurchasing.OnApplicationPause(GooglePlayPurchasing.java:102)
    com.unity3d.player.UnityPlayer.nativePause(Native Method)
    com.unity3d.player.UnityPlayer.i(Unknown Source)
    com.unity3d.player.UnityPlayer$18.run(Unknown Source)
    com.unity3d.player.UnityPlayer.executeGLThreadJobs(Unknown Source)
    com.unity3d.player.UnityPlayer$b.run(Unknown Source)
    UnityEngine.AndroidJNISafe.CheckException ()
    UnityEngine.AndroidJNISafe.CallVoidMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args)
    UnityEngine.AndroidJavaObject._Call (System.String methodName, System.Object[] args)
    UnityEngine.AndroidJavaObject.Call (System.String methodName, System.Object[] args)
    UnityEngine.Purchasing.RawStoreProvider+<GetAndroidStore>c__AnonStorey0.<>m__0 (Boolean paused)
    UnityEngine.Purchasing.Extension.UnityUtil.OnApplicationPause (Boolean paused)​

    It seems to be triggered with the call to InitiatePurchase() itself, and the exception only occurs the first time - subsequent purchases don't throw this. It also doesn't stop me from making the purchase, but I'd still like to know what's going on and if it's a problem.

    This doesn't occur on iOS.

    I'm testing this on 5.3.5p7 (Mac) and I can send on a test project if necessary.

    cc @erika_d, @Banderous
     
  2. NimbleAi

    NimbleAi

    Joined:
    May 14, 2016
    Posts:
    2
    Nicolas1212 likes this.
  3. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @Nicolas1212 and @NimbleAi,

    Sorry you are experiencing this issue! We are aware of it and are working on a fix that we should be able to release shortly! Stay tuned to this page, we will update it when the fix rolls out, thanks for your patience!
     
    Nicolas1212 likes this.
  4. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    Hi! Thanks for your bug reports and patience! Unity IAP 1.6.1 has been released.

    I expect the issue will be fixed by 1.6.1. Please see its changelog: http://forum.unity3d.com/threads/unity-iap-package-1-6-0-is-now-available.415517/#post-2715535 Please re-Import Unity IAP to upgrade to this new version, confirming the version in the Assets/Plugins/UnityPurchasing/Changelog.md file if needed.

    We were not able to reproduce this issue. We did however find and fix a related vulnerability around double-pausing / -resuming for Google Play. Please let us know if this exception recurs!
     
  5. NimbleAi

    NimbleAi

    Joined:
    May 14, 2016
    Posts:
    2
    Hello,

    I installed the new version and it seems to be working, i.e. app can pause without the exception. Thank you for the quick fix.
    Paul
     
    nicholasr likes this.
Thread Status:
Not open for further replies.