The Wayback Machine - http://web.archive.org/web/20201009122314/https://github.com/firebase/quickstart-android/issues/473
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.ClassCastException com.google.android.gms.iid.zzh.onServiceConnected Firebase #473

Open
ZebpayDipen opened this issue Apr 23, 2018 · 23 comments

Comments

@ZebpayDipen
Copy link

@ZebpayDipen ZebpayDipen commented Apr 23, 2018

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

Loading…

Member

@samtstern samtstern commented Apr 23, 2018

@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?
@ZebpayDipen

Loading…

Author

@ZebpayDipen ZebpayDipen commented Apr 24, 2018

@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

Loading…

Member

@samtstern samtstern commented Apr 24, 2018

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

@ZebpayDipen

Loading…

Author

@ZebpayDipen ZebpayDipen commented Apr 25, 2018

@samtstern

Loading…

Member

@samtstern samtstern commented Apr 25, 2018

@ZebpayDipen

Loading…

Author

@ZebpayDipen ZebpayDipen commented Apr 26, 2018

@AmanelX

Loading…

@AmanelX AmanelX commented May 12, 2018

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

Loading…

@railianmaksym railianmaksym commented May 17, 2018

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

@jaipatel10

Loading…

@jaipatel10 jaipatel10 commented May 20, 2018

Hey, did anyone get any proper work around?

@NarayanaraoRayapureddy

Loading…

@NarayanaraoRayapureddy NarayanaraoRayapureddy commented Jun 14, 2018

Any luck with this issue?

@daver1419

Loading…

@daver1419 daver1419 commented Jun 22, 2018

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

Loading…

@keremkusmezer keremkusmezer commented Jun 26, 2018

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

Loading…

@Akhrorjon Akhrorjon commented Jul 16, 2018

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

@skyvvalker

Loading…

@skyvvalker skyvvalker commented Jul 20, 2018

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

@Abu-Abdullah

Loading…

@Abu-Abdullah Abu-Abdullah commented Jul 21, 2018

im getting the same error from huawei android 8.0

@ZebpayDipen

Loading…

Author

@ZebpayDipen ZebpayDipen commented Jul 23, 2018

@neevek

Loading…

@neevek neevek commented Sep 20, 2018

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

Loading…

@AmanelX AmanelX commented Sep 21, 2018

@ogeidix

Loading…

@ogeidix ogeidix commented Sep 24, 2018

@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

Loading…

@shahwaiz90 shahwaiz90 commented Oct 8, 2018

Same issue, any solutions?

@neevek

Loading…

@neevek neevek commented Oct 9, 2018

@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

Loading…

@shahwaiz90 shahwaiz90 commented Oct 9, 2018

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

Loading…

@yy-liuhejun yy-liuhejun commented Mar 18, 2020

im getting the same error from huawei android 10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.