firebase / quickstart-android

Firebase Quickstart Samples for Android
https://firebase.google.com
Apache License 2.0
8.85k stars 7.32k forks source link

java.lang.ClassCastException com.google.android.gms.iid.zzh.onServiceConnected Firebase #473

Open ZebpayDipen opened 6 years ago

ZebpayDipen commented 6 years ago

java.lang.ClassCastException: at com.google.android.gms.iid.zzh.onServiceConnected (zzh.java:4) at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1631) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1660) at android.os.Handler.handleCallback (Handler.java:789) at android.os.Handler.dispatchMessage (Handler.java:98) at android.os.Looper.loop (Looper.java:172) at android.app.ActivityThread.main (ActivityThread.java:6637) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:767)

samtstern commented 6 years ago

@ZebpayDipen we need a lot more information to debug this issue:

ZebpayDipen commented 6 years ago

@samtstern

1) What version of the Firebase Android SDK are you using? ANS : Firebase version is : 12.0.1

2) What code causes this issue? ANS: We don't know actually by which error is coming.

3) How easy is it to reproduce this issue? Can you provide me instructions? ANS: In Android 8.0 and later devices, this is issue came on the very first screen.

4) Is it device or OS specific? ANS: This is OS specific, Android 8.0 and later

Last log for your reference: Process: *.Application:ui4, PID: 18492 java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.google.android.gms.iid.zzf at com.google.android.gms.iid.zzh.onServiceConnected(Unknown Source:4) at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1652) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1681) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

samtstern commented 6 years ago

@ZebpayDipen thank for for the details! That is enough information for me to start an internal investigation,

ZebpayDipen commented 6 years ago

Please ask if any other things you want, waiting for the solution now b'coz playstore crashes are raised to almost 40% due to this.

Regards Dipen Jansari

Android Developer, Zebpay

download Zebpay http://app.zebpay.com/download-signature

What is bitcoin in 2 mins (video) https://www.facebook.com/zebpay/videos/1765947396970777 | @zebpay http://twitter.com/zebpay | Facebook http://fb.com/zebpay

On 25 April 2018 at 00:10, Sam Stern notifications@github.com wrote:

@ZebpayDipen https://github.com/ZebpayDipen thank for for the details! That is enough information for me to start an internal investigation,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-android/issues/473#issuecomment-384037531, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX9RSwfxmxQqGj3v9jwd6aktCSMngbiks5tr3GsgaJpZM4TfqaQ .

samtstern commented 6 years ago

How many crashes are you seeing due to this issue and what are the most common devices that are crashing?

On Tue, Apr 24, 2018, 10:29 PM ZebpayDipen notifications@github.com wrote:

Please ask if any other things you want, waiting for the solution now b'coz playstore crashes are raised to almost 40% due to this.

Regards Dipen Jansari

Android Developer, Zebpay

download Zebpay http://app.zebpay.com/download-signature

What is bitcoin in 2 mins (video) https://www.facebook.com/zebpay/videos/1765947396970777 | @zebpay http://twitter.com/zebpay | Facebook http://fb.com/zebpay

On 25 April 2018 at 00:10, Sam Stern notifications@github.com wrote:

@ZebpayDipen https://github.com/ZebpayDipen thank for for the details! That is enough information for me to start an internal investigation,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/firebase/quickstart-android/issues/473#issuecomment-384037531 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AeX9RSwfxmxQqGj3v9jwd6aktCSMngbiks5tr3GsgaJpZM4TfqaQ

.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-android/issues/473#issuecomment-384164996, or mute the thread https://github.com/notifications/unsubscribe-auth/AIEw6hLFpO7mxdzOdjmfPLvOOv1v2eOoks5tsAmsgaJpZM4TfqaQ .

ZebpayDipen commented 6 years ago

Hey sam, Due to this ANDROID OREO devices are effected. And playstore crashes are about 200K.

Regards Dipen Jansari

Android Developer, Zebpay

On 25 April 2018 at 12:01, Sam Stern notifications@github.com wrote:

How many crashes are you seeing due to this issue and what are the most common devices that are crashing?

On Tue, Apr 24, 2018, 10:29 PM ZebpayDipen notifications@github.com wrote:

Please ask if any other things you want, waiting for the solution now b'coz playstore crashes are raised to almost 40% due to this.

Regards Dipen Jansari

Android Developer, Zebpay

download Zebpay http://app.zebpay.com/download-signature

What is bitcoin in 2 mins (video) https://www.facebook.com/zebpay/videos/1765947396970777 | @zebpay http://twitter.com/zebpay | Facebook http://fb.com/zebpay

On 25 April 2018 at 00:10, Sam Stern notifications@github.com wrote:

@ZebpayDipen https://github.com/ZebpayDipen thank for for the details! That is enough information for me to start an internal investigation,

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/firebase/quickstart-android/issues/473# issuecomment-384037531 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ AeX9RSwfxmxQqGj3v9jwd6aktCSMngbiks5tr3GsgaJpZM4TfqaQ

.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-android/issues/473# issuecomment-384164996, or mute the thread https://github.com/notifications/unsubscribe-auth/ AIEw6hLFpO7mxdzOdjmfPLvOOv1v2eOoks5tsAmsgaJpZM4TfqaQ .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-android/issues/473#issuecomment-384175148, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX9RRO9upnHOjTugjPPcObRBMeWL_2gks5tsBhTgaJpZM4TfqaQ .

AmanelX commented 6 years ago

I've recently found that most of my inexplicable crashes came because i was using an obsolete Google services or Firebase or any other library. Try updating the lib artifacts to their latest versions

railianmaksym commented 6 years ago

Hello, we have this issue to, @samtstern do you already find the reason of this problem?

jaipatel10 commented 6 years ago

Hey, did anyone get any proper work around?

NarayanaraoRayapureddy commented 6 years ago

Any luck with this issue?

daver1419 commented 6 years ago

I have this issue, and the most common devices are these samsung:

captura de pantalla 2018-06-22 a la s 12 42 02
keremkusmezer commented 6 years ago

I have also the same issue my gradle file looks like the following for service descriptions.

// Unique job ID for this service. static final int JOB_ID = 42;

// Convenience method for enqueuing work in to this service.
public static void enqueueWork(Context context, Intent work) {
    enqueueWork(context, XXXService.class, JOB_ID, work);
}

implementation 'com.google.android.gms:play-services-ads:15.0.1' implementation 'com.google.android.gms:play-services-gcm:15.0.1' implementation 'com.google.android.gms:play-services-location:15.0.1' implementation 'com.google.firebase:firebase-messaging:17.0.0'

Akhrorjon commented 6 years ago

Is there anyone who have find the solution for the given issue?

skyvvalker commented 6 years ago

Is there an update? I'm seeing the same issue as @ZebpayDipen - on devices Android 8.0 and later.

Abu-Abdullah commented 6 years ago

im getting the same error from huawei android 8.0

ZebpayDipen commented 6 years ago

I am getting below kind of error in firebase job dispatcher executing service zebpay.Application/com.firebase.jobdispatcher.GooglePlayReceiver

Error: "main" tid=1 Runnable "main" prio=5 tid=1 Runnable | group="main" sCount=0 dsCount=0 obj=0x737a0960 self=0xb8822c78 | sysTid=17779 nice=0 cgrp=default sched=0/0 handle=0xb6f4ab34 | state=R schedstat=( 0 0 0 ) utm=19868 stm=387 core=0 HZ=100 | stack=0xbe28e000-0xbe290000 stackSize=8MB | held mutexes= "mutator lock"(shared held) at com.google.android.gms.internal.firebase_database.zziv.getValue (zziv.java) at com.google.android.gms.internal.firebase_database.zzif.getValue (zzif.java) at com.google.android.gms.internal.firebase_database.zzif.getValue (zzif.java) at com.google.android.gms.internal.firebase_database.zzif.getValue (zzif.java) at com.google.firebase.database.DataSnapshot.getValue (DataSnapshot.java) at zebpay.Application.deepstream.FirebaseStreamConnection$1$1.onRateChanged (FirebaseStreamConnection.java:123) at zebpay.Application.home.HomeRateChangeListener.onDataChange (HomeRateChangeListener.java:35) at com.google.android.gms.internal.firebase_database.zzfc.zza (zzfc.java) at com.google.android.gms.internal.firebase_database.zzgx.zzdr (zzgx.java) at com.google.android.gms.internal.firebase_database.zzhd.run (zzhd.java) at android.os.Handler.handleCallback (Handler.java:739) at android.os.Handler.dispatchMessage (Handler.java:95) at android.os.Looper.loop (Looper.java:168) at android.app.ActivityThread.main (ActivityThread.java:5845) at java.lang.reflect.Method.invoke! (Native method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:68

Regards Dipen Jansari

Android Developer, Zebpay

download Zebpay http://app.zebpay.com/download-signature

What is bitcoin in 2 mins (video) https://www.facebook.com/zebpay/videos/1765947396970777 | @zebpay http://twitter.com/zebpay | Facebook http://fb.com/zebpay

On Sat, 21 Jul 2018 at 22:06, Abu-Abdullah notifications@github.com wrote:

im getting the same from huawei android 8.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-android/issues/473#issuecomment-406808408, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX9RUcapZf4_I-FlNFN-Q7ryjpDgf1eks5uI1iPgaJpZM4TfqaQ .

neevek commented 6 years ago

I also encountered the same issue:

java.lang.ClassCastException: android.os.BinderProxy cannot be cast to com.google.firebase.iid.zzf

I notice that when I run FirebaseMessagingService in the main process, it works, but when a put the service in background process, the above exception is thrown, and onMessageReceived never gets called.

AmanelX commented 6 years ago

There might be a connection to this https://stackoverflow.com/questions/51353493/not-allowed-to-start-service-intent-android-oreo

ogeidix commented 6 years ago

@neevek Firebase Messaging is not designed to work in non-primary process. It's possible but it would require multiple changes in your configuration. Would be possible for you to process the messages in the primary process ?

@ZebpayDipen Please open a different bug for issue on Firebase Job Dispatcher

For all: could you please try with the latest version of the FCM library and see if the problem still exists? Thanks

shahwaiz90 commented 6 years ago

Same issue, any solutions?

neevek commented 6 years ago

@neevek Firebase Messaging is not designed to work in non-primary process. It's possible but it would require multiple changes in your configuration. Would be possible for you to process the messages in the primary process ?

@ZebpayDipen Please open a different bug for issue on Firebase Job Dispatcher

For all: could you please try with the latest version of the FCM library and see if the problem still exists? Thanks

Yes, I can process the messages in the primary process.

shahwaiz90 commented 6 years ago

Upgraded my firebase API to 17.3.3 from 12.0.0 implementation 'com.google.firebase:firebase-messaging:17.3.3' issue solved.

my gradle files: compile 'com.google.android.gms:play-services-auth:16.0.1' compile 'com.google.android.gms:play-services-maps:16.0.0' compile 'com.google.android.gms:play-services-location:16.0.0' compile 'com.google.android.gms:play-services-analytics:16.0.4' compile 'com.google.firebase:firebase-core:16.0.4' compile 'com.google.firebase:firebase-crash:16.2.1' implementation 'com.google.firebase:firebase-messaging:17.3.3' implementation 'com.google.firebase:firebase-perf:16.1.2'

firebase release notes: https://firebase.google.com/support/release-notes/android

yy-liuhejun commented 4 years ago

im getting the same error from huawei android 10.0

GuptaMunna commented 3 years ago

Im getting the same error on android 11.