Search Unity

Activity io.branch.unity.BranchUnityActivity has leaked IntentReceiver com.unity.purchasing.googlepl

Discussion in 'Unity IAP' started by fox, Mar 28, 2019.

  1. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Hello. We are using Bransch in our game. If we quit the game from the native android back button (using Application.Quit), we get this error:

    Activity io.branch.unity.BranchUnityActivity has leaked IntentReceiver com.unity.purchasing.googleplay.GooglePlayPurchasing$5@398122e that was originally registered here. Are you missing a call to unregisterReceiver()?

    Anyone has an idea on how to solve that error? It causes big troubles next time we start the app and try to initialize the Unity IAP.

    Here is our log:
     
    Last edited: Mar 28, 2019
  2. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Note, we are using the latest Unity IAP version.
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, what is Bransch? How does it affect IAP on the next app launch? Typically you should not put much logic in Application.Quit as services and components are in the process of unloading. I'm not seeing any IAP mention in the logs. And you are quitting the game when the user presses the back button? Why is that?
     
  4. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Thanks for answering @JeffDUnity3D .
    Branch is a deep-linking plugin .. https://branch.io
    Well, I guess it's kind of common to use the physical back button to quit the game on Android devices? it was actually a request from the google team (they asked for that when they were about to feature our game). We are only making the call to Application.quit when pushing the button, nothing else in that call.

    com.unity.purchasing.googleplay.BillingServiceManager seems released to Unity IAP, right? We are not using any other IAP plugin..

    Next time we start the game, it crashes on the UnityPurchasing.Initialize method with a "UnityEngine._AndroidJNIHelper.InvokeJavaProxyMethod" -error.

    The crash seems to happen only if we quit before the UnityPurchasing.Initialize is finished..
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So IAP works when you first install. Then later the game crashes as you suggest when you click the back button. You wait until tomorrow (for example), and run the game, and now IAP does not initialize. And if you keep trying, it never initializes? The only time IAP actually works is the very first install and launch? And if you hit the back button, IAP never works again. That is quite odd if so, if I am understanding correctly. A previous launch (and crash) should not affect subsequent launches. I'm not clear on your mention "The crash seems to happen only if we quit before the UnityPurchasing.Initialize is finished.", so you quickly hit the back button to exit the game, even before it loads? Not many users would do that, so thankfully this looks like a rare issue, right? Please provide the device logs after a new install, and not pressing the back button to trigger the (permanent) crash scenario. Then provide the subsequent logs after the crash, on next app launch. https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/ Have you contacted Branch (I used to work for them, I didn't recognize it as you had misspelled their name, great company!)
     
  6. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Oh, sorry about the misspelling:)
    They said it was a unity engine error, referring to this post:
    https://forum.unity.com/threads/uni...-error-when-android-app-force-closing.531778/

    Yes, I press the quit app button as soon as my "main menu" is loaded, but before the iap is initialized. It should be a rare issue, unless it doesn't behave like this entering the game in offline mode, quits and then next time has a connection (haven't tested that yet).

    I haven't yet tested with closing the app with the app switcher, but I will do some tests with that tomorrow.
    I will also send you the full logs.
     
  7. fox

    fox

    Joined:
    Jan 14, 2009
    Posts:
    118
    Forget what I said about this happen only if we quit before the UnityPurchasing.Initialize is finished. It happens every time I use the back button and call Application.Quit. I will send you full logs in a DM @JeffDUnity3D
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    And can you elaborate, when this occurs, IAP never again works? Please don't DM, post here or open a support ticket. But at any rate, I don't believe this would be an IAP issue. If it turns out to be a Branch issue, you would need to contact them.
     
  9. sayiliromer

    sayiliromer

    Joined:
    May 30, 2017
    Posts:
    11
    We are having very similar issue. Issue starts with Application.Quit() , If you kill app with Application.Quit(). These three exceptions thrown. And after you relaunch the app. Iap does not work and Googleplay services doesnt work as well.



     
  10. solinv

    solinv

    Joined:
    Dec 2, 2016
    Posts:
    1
    We're observing the same behaviour after the first Application.Quit() (without using branch library).

    Tried on 2019.1.1 and 2018.3.13. We're on unity-purchasing 2.0.3 if that matters. Any input?
     
  11. glenhunter

    glenhunter

    Unity Technologies

    Joined:
    Apr 2, 2019
    Posts:
    92