Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Unable to bind to service io.appmetrica.analytics.internal.AppMetricaService #7

Closed
E-D-W-I-N opened this issue Jun 6, 2024 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@E-D-W-I-N
Copy link

E-D-W-I-N commented Jun 6, 2024

📚 AppMetrica SDK Version

6.5.0

📝 Description

After migration from 5.2.0 to 6.5.0 appmetrica SDK I got bunch of background crashes because of AppMetricaService binding error

100% of crashes are coming from Android 7.0 and 7.1.2, no other OS version is affected
image

I've found this issue on archived repo of appmetrica - yandexmobile/metrica-sdk-android#92
This is exactly my problem, just on a newer SDK version

🔍 Reproducing the issue

  1. Just open the app. According to Firebase this is an early crash, occuring just after 1 second of app running

📋 Relevant AppMetrica Log Output or Crash Logs

Expand to view logs
Fatal Exception: java.lang.RuntimeException: Unable to bind to service io.appmetrica.analytics.internal.AppMetricaService@8ca6b22 with Intent { act=io.appmetrica.analytics.IAppMetricaService dat=appmetrica://com.example.app/client?pid=3737&psid=bd4bac8e-7067-4bf7-9932-d36769d8eedd flg=0x20 pkg=com.example.app cmp=com.example.app/io.appmetrica.analytics.internal.AppMetricaService (has extras) }: java.lang.IllegalArgumentException
       at android.app.ActivityThread.handleBindService(ActivityThread.java:3233)
       at android.app.ActivityThread.-wrap3(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1573)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6121)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
Caused by java.lang.IllegalArgumentException:
       at android.os.Parcel.nativeAppendFrom(Parcel.java)
       at android.os.Parcel.appendFrom(Parcel.java:463)
       at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1395)
       at android.os.Bundle.writeToParcel(Bundle.java:1157)
       at android.os.Parcel.writeBundle(Parcel.java:764)
       at android.content.Intent.writeToParcel(Intent.java:8687)
       at android.app.ActivityManagerProxy.publishService(ActivityManagerNative.java:4430)
       at android.app.ActivityThread.handleBindService(ActivityThread.java:3220)
       at android.app.ActivityThread.-wrap3(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1573)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6121)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

📦 Dependencies

@E-D-W-I-N E-D-W-I-N added the bug Something isn't working label Jun 6, 2024
@alexklints
Copy link
Member

Hi. Thank you for your feedback.

The problem arises due to the specifics of the application update process on Android 7. When updating the application, the system does not stop all application processes. This leads to the desynchronization of the client and service code. At the same time, there was a race condition in the implementation of the BaseBundle of this version of AOSP.
Unfortunately, we can't do anything about this situation. The good news is that after updating the audience to the current version of the application, the problem should go away (or become much less frequent). If this does not happen, please reopen the issue.

@alexklints alexklints added the wontfix This will not be worked on label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants