Search Unity

Resolved ANR on android

Discussion in 'Unity IAP' started by TermerAlexander, Jun 1, 2022.

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

    TermerAlexander

    Joined:
    Jan 25, 2016
    Posts:
    10
    Hi, we have released the game on google play. And we have this ANR, how can we fix it?

    Unity 2019.4.38
    Iaps 4.1.5

    It looks like the problem is in the billing library, but we have the newest version of unity iap library

    at java.lang.Object.wait (Native method)
    at java.lang.Thread.parkFor$ (Thread.java:2153)
    at sun.misc.Unsafe.park (Unsafe.java:358)
    at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230)
    at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:447)
    at java.util.concurrent.FutureTask.get (FutureTask.java:205)
    at com.android.billingclient.api.BillingClientImpl.queryPurchases
    at com.unity3d.player.ReflectionHelper.nativeProxyInvoke (Native method)
    at com.unity3d.player.ReflectionHelper.a (unavailable)
    at com.unity3d.player.ReflectionHelper$1.invoke (unavailable)
    at java.lang.reflect.Proxy.invoke (Proxy.java:913)
    at com.android.billingclient.api.BillingClientStateListener.onBillingSetupFinished
    at com.android.billingclient.api.zzae.run
    at android.os.Handler.handleCallback (Handler.java:795)
    at android.os.Handler.dispatchMessage (Handler.java:99)
    at android.os.Looper.loop (Looper.java:166)
    at android.app.ActivityThread.main (ActivityThread.java:6861)
    at java.lang.reflect.Method.invoke (Native method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:450)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  3. Jayesh_101

    Jayesh_101

    Joined:
    Sep 15, 2022
    Posts:
    9
    I Dont find any solution please tell me as soon as possible
    Thank you
     
  4. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    235
    The other post referenced is this one:
    https://forum.unity.com/threads/onskudetailsresponse-anr-android.1290179/

    Since this seems to be a problem on Google's side with Google Play Billing Library v3, updating to Unity IAP 4.5.1 with GPBLv4 should solve this.

    If you still have issues after updating, could you include more details regarding your specific problem?
     
  5. Jayesh_101

    Jayesh_101

    Joined:
    Sep 15, 2022
    Posts:
    9
    Thank you
    If I have updated to Unity IAP 4.5.1 then I don't get a response when a user purchases a subscription.
    Even in package manager don't show any update regarding in app purchasing .
     
    Last edited: Nov 4, 2022
  6. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    235
    Could you provide more information to reproduce your problem?

    When a user purchases a subscription, the purchase should go through the IStoreListener ProcessPurchase that you implemented.

    For the package manager, it depends on the editor version, but you might have to manually add the package if it's not showing
     
  7. Jayesh_101

    Jayesh_101

    Joined:
    Sep 15, 2022
    Posts:
    9
    Thank you
    Problem is solved.
     
  8. Arnaud_Gorain

    Arnaud_Gorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    182
    This thread is now closed. Feel free to reach out via a new thread if you encounter further issues.
    Thanks!
     
Thread Status:
Not open for further replies.