google / play-services-plugins

Plugins to help with using Google Play services SDK.
https://developers.google.com/android/guides/overview
Apache License 2.0
470 stars 137 forks source link

App crash while launch #244

Open lhx546920268 opened 2 years ago

lhx546920268 commented 2 years ago

App will crash while launch in device Redmi Note 7, Redmi 8A android 10.0

Fatal Exception: java.lang.SecurityException: addOnPermissionsChangeListener: Neither user 10159 nor current process has android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS.
       at android.os.Parcel.createException(Parcel.java:2074)
       at android.os.Parcel.readException(Parcel.java:2042)
       at android.os.Parcel.readException(Parcel.java:1990)
       at com.google.android.gms.common.internal.zzac.getService(zzac.java:33)
       at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(BaseGmsClient.java:2)
       at com.google.android.gms.common.internal.BaseGmsClient$LegacyClientCallbackAdapter.a(BaseGmsClient.java:13)
       at com.google.android.gms.common.internal.zzg.zzd(zzg.java:6)
       at com.google.android.gms.common.internal.zza.a(zza.java:6)
       at com.google.android.gms.common.internal.zzc.zze(zzc.java:26)
       at com.google.android.gms.common.internal.zzb.handleMessage(zzb.java:26)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:224)
       at android.app.ActivityThread.main(ActivityThread.java:7590)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

google service

classpath 'com.google.gms:google-services:4.3.13'

firebase version

    implementation platform('com.google.firebase:firebase-bom:30.3.1')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-messaging-ktx'
amit-bst commented 1 year ago

I am facing it too. Any possibly reasons ?

cookapps-jhlee8 commented 1 year ago

I am facing it too Xiaomi MI 8, Android 10

Fatal Exception: java.lang.Error: FATAL EXCEPTION [main] Unity version : 2021.3.24f1 Device model : Xiaomi MI 8 Device fingerprint: Xiaomi/dipper/dipper:10/QKQ1.190828.002/V12.5.2.0.QEACNXM:user/release-keys Build Type : Release Scripting Backend : IL2CPP ABI : arm64-v8a Strip Engine Code : true

Caused by java.lang.SecurityException: addOnPermissionsChangeListener: Neither user 10491 nor current process has android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS. at android.os.Parcel.createException(Parcel.java:2074) at android.os.Parcel.readException(Parcel.java:2042) at android.os.Parcel.readException(Parcel.java:1990) at com.google.android.gms.common.internal.zzac.getService(com.google.android.gms:play-services-basement@@18.1.0:9) at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(com.google.android.gms:play-services-basement@@18.1.0:14) at com.google.android.gms.common.internal.BaseGmsClient$LegacyClientCallbackAdapter.onReportServiceBinding(com.google.android.gms:play-services-basement@@18.1.0:2) at com.google.android.gms.common.internal.zzg.zzd(com.google.android.gms:play-services-basement@@18.1.0:1) at com.google.android.gms.common.internal.zza.zza(com.google.android.gms:play-services-basement@@18.1.0:4) at com.google.android.gms.common.internal.zzc.zze(com.google.android.gms:play-services-basement@@18.1.0:3) at com.google.android.gms.common.internal.zzb.handleMessage(com.google.android.gms:play-services-basement@@18.1.0:31) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7562) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

ucf0709 commented 1 year ago

Same here Fatal Exception: java.lang.SecurityException: Binder invocation to an incorrect interface at android.os.Parcel.createExceptionOrNull(Parcel.java:2385) at android.os.Parcel.createException(Parcel.java:2369) at android.os.Parcel.readException(Parcel.java:2352) at android.os.Parcel.readException(Parcel.java:2294) at com.google.android.gms.common.internal.zzac.getService(com.google.android.gms:play-services-basement@@18.1.0:9) at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(com.google.android.gms:play-services-basement@@18.1.0:14) at com.google.android.gms.common.internal.BaseGmsClient$LegacyClientCallbackAdapter.onReportServiceBinding(com.google.android.gms:play-services-basement@@18.1.0:2) at com.google.android.gms.common.internal.zzg.zzd(com.google.android.gms:play-services-basement@@18.1.0:1) at com.google.android.gms.common.internal.zza.zza(com.google.android.gms:play-services-basement@@18.1.0:4) at com.google.android.gms.common.internal.zzc.zze(zzc.java:3) at com.google.android.gms.common.internal.zzb.handleMessage(com.google.android.gms:play-services-basement@@18.1.0:31) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8633) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

herisulistiyanto commented 1 year ago

Any update on this issue?

Get the same error on OPPO A5 2020 (Android 10)

Google Service

com.google.gms.google-services:4.4.0

firebase

com.google.firebase:firebase-bom:32.3.1
com.google.firebase:firebase-crashlytics-ktx
com.google.firebase:firebase-analytics-ktx

Stacktrace

Fatal Exception: java.lang.SecurityException: Binder invocation to an incorrect interface
       at android.os.Parcel.createException(Parcel.java:2087)
       at android.os.Parcel.readException(Parcel.java:2055)
       at android.os.Parcel.readException(Parcel.java:2003)
       at com.google.android.gms.common.internal.zzac.getService(com.google.android.gms:play-services-basement@@18.1.0:9)
       at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService(com.google.android.gms:play-services-basement@@18.1.0:14)
       at com.google.android.gms.common.internal.BaseGmsClient$LegacyClientCallbackAdapter.onReportServiceBinding(com.google.android.gms:play-services-basement@@18.1.0:2)
       at com.google.android.gms.common.internal.zzg.zzd(com.google.android.gms:play-services-basement@@18.1.0:1)
       at com.google.android.gms.common.internal.zza.zza(com.google.android.gms:play-services-basement@@18.1.0:4)
       at com.google.android.gms.common.internal.zzc.zze(zzc.java:3)
       at com.google.android.gms.common.internal.zzb.handleMessage(com.google.android.gms:play-services-basement@@18.1.0:31)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:238)
       at android.app.ActivityThread.main(ActivityThread.java:7864)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:998)
ucf0709 commented 1 year ago

they dont care I guess

ucf0709 commented 11 months ago

Hello everyone I noticed that the issue happen only on release versions & it was due to proguard obfuscation in my case, I resolved it by adding below lines to proguard-rules.pro:

Keep the Google Play services classes

-keep class com.google.android.gms. { *; } -keep interface com.google.android.gms.* { ; } -keep class com.google.android.gms.ads. { *; } -keep interface com.google.android.gms.ads.* { ; } -dontwarn com.google.android.gms.**

-keep class com.google.firebase.* { ; } -keep interface com.google.firebase.* { ; }

AndroidDeveloperLB commented 10 months ago

@ucf0709 I think you miss * before each ; . No?

AndroidDeveloperLB commented 7 months ago

@ucf0709 I think this issue still exist, sadly. Maybe less common though.

davidmotson commented 6 months ago

@AndroidDeveloperLB: Is it still occuring for you if you implement the changes suggested by @ucf0709?

AndroidDeveloperLB commented 6 months ago

@davidmotson Yes, I wrote it 4 days ago. Why ask again ? Something changed in the recent 4 days? Happened even today (April 10th). Look: https://console.firebase.google.com/u/0/project/app-manager-cdf2c/crashlytics/app/android:com.lb.app_manager/issues/8d782ca9e751c6476994a4d4f4ad0075?time=last-seven-days&types=crash&sessionEventKey=661645D302DB0001232D76147E179E0D_1934589424762443526

chrome_2024-04-11_01-07-03.zip

What I added is:

-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.* { *; }
-keep class com.google.android.gms.ads.* { *; }
-keep interface com.google.android.gms.ads.* { *; }
-dontwarn com.google.android.gms.*

-keep class com.google.firebase.** { *; }
-keep interface com.google.firebase.* { *; }
sebastianharder commented 1 month ago
-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }

This fixes the issue for me as well. Not happy about it, though.

My stacktrace:

Exception java.lang.SecurityException: Binder invocation to an incorrect interface
  at android.os.Parcel.createExceptionOrNull (Parcel.java:3069)
  at android.os.Parcel.createException (Parcel.java:3053)
  at android.os.Parcel.readException (Parcel.java:3036)
  at android.os.Parcel.readException (Parcel.java:2978)
  at com.google.android.gms.common.internal.zzad.getService (com.google.android.gms:play-services-basement@@18.3.0)
  at com.google.android.gms.common.internal.BaseGmsClient.getRemoteService (com.google.android.gms:play-services-basement@@18.3.0)
  at com.google.android.gms.common.ConnectionResult.isSuccess (ConnectionResult.java)
  at com.google.android.gms.common.internal.BaseGmsClient$LegacyClientCallbackAdapter.onReportServiceBinding (BaseGmsClient.java)
  at com.google.android.gms.common.internal.zzg.zzd (com.google.android.gms:play-services-basement@@18.3.0)
  at com.google.android.gms.common.internal.zza.zza (com.google.android.gms:play-services-basement@@18.3.0)
  at com.google.android.gms.common.internal.zzb.handleMessage (com.google.android.gms:play-services-basement@@18.3.0)