quickstart-android icon indicating copy to clipboard operation
quickstart-android copied to clipboard

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

Open ZebpayDipen opened this issue 7 years ago • 24 comments

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)

ZebpayDipen avatar Apr 23 '18 10:04 ZebpayDipen

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

  • What version of the Firebase Android SDK are you using?
  • What code causes this issue?
  • How easy is it to reproduce this issue? Can you provide me instructions?
  • Is it device or OS specific?

samtstern avatar Apr 23 '18 15:04 samtstern

@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)

ZebpayDipen avatar Apr 24 '18 05:04 ZebpayDipen

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

samtstern avatar Apr 24 '18 18:04 samtstern

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 [email protected] 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 .

ZebpayDipen avatar Apr 25 '18 05:04 ZebpayDipen

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 [email protected] 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 [email protected] 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 .

samtstern avatar Apr 25 '18 06:04 samtstern

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 [email protected] 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 [email protected] 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 [email protected] 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 .

ZebpayDipen avatar Apr 26 '18 05:04 ZebpayDipen

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

AmanelX avatar May 12 '18 15:05 AmanelX

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

railianmaksym avatar May 17 '18 09:05 railianmaksym

Hey, did anyone get any proper work around?

jaipatel10 avatar May 20 '18 06:05 jaipatel10

Any luck with this issue?

NarayanaraoRayapureddy avatar Jun 14 '18 11:06 NarayanaraoRayapureddy

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

captura de pantalla 2018-06-22 a la s 12 42 02

daver1419 avatar Jun 22 '18 15:06 daver1419

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'

keremkusmezer avatar Jun 26 '18 22:06 keremkusmezer

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

Akhrorjon avatar Jul 16 '18 09:07 Akhrorjon

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

skyvvalker avatar Jul 20 '18 18:07 skyvvalker

im getting the same error from huawei android 8.0

Abu-Abdullah avatar Jul 21 '18 16:07 Abu-Abdullah

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 [email protected] 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 .

ZebpayDipen avatar Jul 23 '18 05:07 ZebpayDipen

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.

neevek avatar Sep 20 '18 03:09 neevek

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

AmanelX avatar Sep 21 '18 08:09 AmanelX

@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

ogeidix avatar Sep 24 '18 20:09 ogeidix

Same issue, any solutions?

shahwaiz90 avatar Oct 08 '18 11:10 shahwaiz90

@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.

neevek avatar Oct 09 '18 01:10 neevek

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

shahwaiz90 avatar Oct 09 '18 12:10 shahwaiz90

im getting the same error from huawei android 10.0

yy-liuhejun avatar Mar 18 '20 07:03 yy-liuhejun

Im getting the same error on android 11.

GuptaMunna avatar May 20 '21 06:05 GuptaMunna