playgameservices / android-basic-samples

Google Play game services - Android samples
Apache License 2.0
971 stars 973 forks source link

BadParcelableException for Google Login API #207

Closed StilianosTzouvaras closed 7 years ago

StilianosTzouvaras commented 8 years ago

Google play services: 9.0.2 Support libs: 24.0.0 Android studio 2.2 Preview 4 Gradle 2.2-alpha-4

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: 佅￿l￿https://www.googleapis.com/auth/plus.login,佅￿$￿profile(佅￿ ￿email,佅￿$￿ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) at android.app.ActivityThread.access$900(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java) at android.os.Handler.dispatchMessage(Handler.java) at android.os.Looper.loop(Looper.java) at android.app.ActivityThread.main(ActivityThread.java) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: 佅￿l￿https://www.googleapis.com/auth/plus.login,佅￿$￿profile(佅￿ ￿email,佅￿$￿ at android.os.Parcel.readException(Parcel.java) at android.os.Parcel.readException(Parcel.java) at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java) at android.app.Instrumentation.execStartActivity(Instrumentation.java) at android.app.Activity.startActivityForResult(Activity.java) at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75) at android.app.Activity.startActivityForResult(Activity.java) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:871) at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.zzj(Unknown Source) at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onCreate(Unknown Source) at android.app.Activity.performCreate(Activity.java) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java) at android.app.ActivityThread.access$900(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java) at android.os.Handler.dispatchMessage(Handler.java) at android.os.Looper.loop(Looper.java) at android.app.ActivityThread.main(ActivityThread.java) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

mayank250004 commented 7 years ago

Any Solution ?? i have same issue!

ifynk commented 7 years ago

I have too

arisembekss commented 7 years ago

I have too.. So how to fix it? I've been spend a ton time to find the solution but still can't found it. In my case that crash log just happen in xiaomi device

grydstedt commented 7 years ago

Me too. Any help?

nsmesta commented 7 years ago

Anybody here with the solution ?Please help

akkishinde commented 7 years ago

The fix for this will be out in Play services 10.4 You can see this thread, https://github.com/googlesamples/google-services/issues/240

isaisachen commented 7 years ago

This is a different issue than googlesamples/google-services#240.

Anyone has repro or bug report?

claywilkinson commented 7 years ago

This has been fixed in the last SDK update. Please reopen this issue with a log of it happening if you encounter the problem after updating.

ankit209 commented 7 years ago

@claywilkinson Nope, it seems the exact same issue still persists in sdk 11.0.2 support lib: 25.3.1 device: Xiaomi Redmi Note 3 play-services version: 11.0.2

This is how I am invoking google sign in from my fragment:

Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
getActivity().startActivityForResult(signInIntent, REQUEST_GOOGLE_SIGN_IN);

And I am getting the same crash

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sharesmile.share/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: ,佅￿$￿openid￿˜H159550091621-ja0nfl97se4qeeqcc4950fdqu20b5ipj.apps.googleuserconte at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394) at android.app.ActivityThread.access$800(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5276) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: ,佅￿$￿openid￿˜H159550091621-ja0nfl97se4qeeqcc4950fdqu20b5ipj.apps.googleuserconte at android.os.Parcel.readException(Parcel.java:1548) at android.os.Parcel.readException(Parcel.java:1499) at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2441) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1500) at android.app.Activity.startActivityForResult(Activity.java:3796) at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79) at android.app.Activity.startActivityForResult(Activity.java:3757) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:859) at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onCreate(Unknown Source) at android.app.Activity.performCreate(Activity.java:6041) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394) at android.app.ActivityThread.access$800(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5276) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

isaisachen commented 7 years ago

While we cannot repro on Xiaomi devices with Google Play services, we did find a repro on a Xiaomi device without Google Play services. We will have a potential fix in new version of SDK this Sep / Oct.

elsennov commented 7 years ago

Agree with @ankit209 , still happen in play services 11.0.2. For me it is in Meizu device.

autonomousapps commented 6 years ago

Can we please re-open this ticket? It's still happening. I work for Chess.com and we recently added google sign-in capabilities. We have 300k daily users and I'm seeing it at around ~9x per day. We are using play services 11.8.0.

Here's a screencap from our Crashlytics dashboard: screenshot from 2018-01-19 10-01-54

Here's the stacktrace:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.chess/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2678)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2747)
       at android.app.ActivityThread.access$900(ActivityThread.java:187)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1585)
       at android.os.Handler.dispatchMessage(Handler.java:111)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5879)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1119)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.google.android.gms.auth.api.signin.internal.SignInConfiguration
       at android.os.Parcel.readException(Parcel.java:1548)
       at android.os.Parcel.readException(Parcel.java:1499)
       at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2639)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1573)
       at android.app.Activity.startActivityForResult(Activity.java:3830)
       at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
       at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)
       at android.app.Activity.startActivityForResult(Activity.java:3787)
       at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:720)
       at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onCreate(Unknown Source)
       at android.app.Activity.performCreate(Activity.java:6127)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2631)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2747)
       at android.app.ActivityThread.access$900(ActivityThread.java:187)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1585)
       at android.os.Handler.dispatchMessage(Handler.java:111)
       at android.os.Looper.loop(Looper.java:194)
       at android.app.ActivityThread.main(ActivityThread.java:5879)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1119)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)
mwgray commented 6 years ago

Hi @autonomousapps,

Can you provide some more information? When you say 9x, do you mean you only see it happen 9 times per day out of 300,000 users?

Also, what is the package name/link of your app?

autonomousapps commented 6 years ago

@mwgray thanks for the reply.

  1. Yes, 9 times per day out of 300k daily average users (1.2M/month). Not huge, but I don't like adding new crashes to my app. And generally I care about anything that happens >1 time per day.
  2. https://play.google.com/store/apps/details?id=com.chess&hl=en

I can provide any more info you need -- just ask :)

isaisachen commented 6 years ago

@autonomousapps, looks like it mostly happened to Meizu devices. I think these devices don't have Google Play services.

It's unfortunate that it's crashing, but just a note that Google Sign-In can't work on these devices any ways. A workaround is to skip sign-in when Google Play services is not available.

GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance(); if (apiAvailability.isGooglePlayServicesAvailable(this) != ConnectionResult.SUCCESS) { // show message and skip sign-in. }

autonomousapps commented 6 years ago

@isaisachen thanks for the hint! I'll take a look.

autonomousapps commented 6 years ago

For anyone else looking at this, the isGooglePlayServicesAvailable(Context) method doesn't return a boolean. It returns an int (doc). If you don't care about edge cases, you can check for availability by comparing to ConnectionResult.SUCCESS.

isaisachen commented 6 years ago

Thanks @autonomousapps I corrected my code snippet above.

autonomousapps commented 6 years ago

I'm going to roll this fix out to prod today. I should know by Monday if it addresses the crashes. I'll update this issue then!

aritraroy commented 6 years ago

@autonomousapps Any updates on this? We are also facing the same issue, but in our case, the users do have Google Play Services is installed on their device. The crash just happens once or twice when they try to login but works after that. It mainly happens on Xioami devices.

autonomousapps commented 6 years ago

@aritraroy I no longer see that crash, after first checking for the presence of GPS. If you're seeing that crash when you're sure GPS is available, it might be a different issue.

aritraroy commented 6 years ago

@autonomousapps Cool, btw which version of Play Services are you in?

mwgray commented 6 years ago

@aritraroy, what is the package name/link of your app?

How often are you seeing the crash? Are you able to reproduce it locally/consistently?

autonomousapps commented 6 years ago

@aritraroy play services 11.8.0.

akkishinde commented 6 years ago

@aritraroy lets try this