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

android.os.BadParcelableException: Unable to start activity ComponentInfo{com.mixpanel.android.surveys.SurveyActivity} #251

Closed
Digisha opened this issue Aug 6, 2015 · 17 comments
Labels

Comments

@Digisha
Copy link

Digisha commented Aug 6, 2015

Hi,

Mixpanel SDK: 'com.mixpanel.android:mixpanel-android:4.5.3'

Our app crashes with the following stack traces.


java.lang.RuntimeException: Unable to start activity ComponentInfo{<packagename>/com.mixpanel.android.surveys.SurveyActivity}: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.mixpanel.android.mpmetrics.Survey
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2661)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Caused by: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.mixpanel.android.mpmetrics.Survey
at android.os.Parcel.readParcelableCreator(Parcel.java:2298)
at android.os.Parcel.readParcelable(Parcel.java:2239)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getInt(BaseBundle.java:781)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState.<init>(UpdateDisplayState.java:184)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState.<init>(UpdateDisplayState.java:107)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState$1.a(UpdateDisplayState.java:116)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState$1.createFromParcel(UpdateDisplayState.java:111)
at android.os.Parcel.readParcelable(Parcel.java:2246)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.BaseBundle.getString(BaseBundle.java:918)
at com.mixpanel.android.mpmetrics.UpdateDisplayState.<init>(UpdateDisplayState.java:424)
at com.mixpanel.android.mpmetrics.UpdateDisplayState.<init>(UpdateDisplayState.java:25)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$1.a(UpdateDisplayState.java:380)
at com.mixpanel.android.mpmetrics.UpdateDisplayState$1.createFromParcel(UpdateDisplayState.java:375)
at android.os.Parcel.readParcelable(Parcel.java:2246)
at android.os.Parcel.readValue(Parcel.java:2146)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.Bundle.getParcelable(Bundle.java:804)
at android.app.Activity.onCreate(Activity.java:981)
at com.mixpanel.android.surveys.SurveyActivity.onCreate(SurveyActivity.java:65)
at android.app.Activity.performCreate(Activity.java:6221)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
... 10 more
@Digisha Digisha changed the title android.os.BadParcelableException: Unable to start activity ComponentInfo{com.pocketgeek.android/com.mixpanel.android.surveys.SurveyActivity} android.os.BadParcelableException: Unable to start activity ComponentInfo{com.mixpanel.android.surveys.SurveyActivity} Aug 6, 2015
@lnanek
Copy link

lnanek commented Aug 24, 2015

Seeing the same problem with 4.6.0:

compile 'com.mixpanel.android:mixpanel-android:4.6.0'
java.lang.RuntimeException: Unable to start activity ComponentInfo{<app package>/com.mixpanel.android.surveys.SurveyActivity}: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called  CREATOR on class com.mixpanel.android.mpmetrics.Survey
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
    at android.app.ActivityThread.access$900(ActivityThread.java:177)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5942)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called  CREATOR on class com.mixpanel.android.mpmetrics.Survey
    at android.os.Parcel.readParcelableCreator(Parcel.java:2298)
    at android.os.Parcel.readParcelable(Parcel.java:2239)
    at android.os.Parcel.readValue(Parcel.java:2146)
    at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
    at android.os.BaseBundle.unparcel(BaseBundle.java:221)
    at android.os.BaseBundle.getInt(BaseBundle.java:781)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState.<init>(SourceFile:184)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState.<init>(SourceFile:107)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState$1.createFromParcel(SourceFile:116)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$DisplayState$SurveyState$1.createFromParcel(SourceFile:111)
    at android.os.Parcel.readParcelable(Parcel.java:2246)
    at android.os.Parcel.readValue(Parcel.java:2146)
    at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
    at android.os.BaseBundle.unparcel(BaseBundle.java:221)
    at android.os.BaseBundle.getString(BaseBundle.java:918)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState.<init>(SourceFile:424)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState.<init>(SourceFile:25)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$1.createFromParcel(SourceFile:380)
    at com.mixpanel.android.mpmetrics.UpdateDisplayState$1.createFromParcel(SourceFile:375)
    at android.os.Parcel.readParcelable(Parcel.java:2246)
    at android.os.Parcel.readValue(Parcel.java:2146)
    at android.os.Parcel.readArrayMapInternal(Parcel.java:2479)
    at android.os.BaseBundle.unparcel(BaseBundle.java:221)
    at android.os.Bundle.getParcelable(Bundle.java:804)
    at android.app.Activity.onCreate(Activity.java:991)
    at com.mixpanel.android.surveys.SurveyActivity.onCreate(SourceFile:65)
    at android.app.Activity.performCreate(Activity.java:6289)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
    ... 10 more

@yinfeiru yinfeiru added the bug label Jan 26, 2016
@Digisha
Copy link
Author

Digisha commented Feb 9, 2016

We are still getting this errors on mixpanel v4.7.0. Are there any updates about this crash?

@Digisha
Copy link
Author

Digisha commented Mar 25, 2016

We updated Mixpanel to 4.8.0. We also turned on surveys in our app which is causing our app with this crash. Can you please fix this?

@patedit
Copy link
Contributor

patedit commented Mar 25, 2016

@Digisha I've just pushed a change and it should fix it. Are you using proguard when this crash happens?

@Digisha
Copy link
Author

Digisha commented Mar 28, 2016

@patedit Thanks for the fix. Yes, the crash happening on our release build which has proguard turned on.

@patedit
Copy link
Contributor

patedit commented Mar 28, 2016

@Digisha Thanks for the info! Let me know if 4.8.5 fixes your issue. I'll keep this open until we make sure you don't face it anymore. Thanks! :)

@Digisha
Copy link
Author

Digisha commented May 2, 2016

@patedit We have a build running with 4.8.5 fixes and we are not seeing this issue anymore. Thanks again for the fix.

@patedit
Copy link
Contributor

patedit commented May 2, 2016

Thanks for the update! Glad it is solved :)

@patedit patedit closed this as completed May 2, 2016
@Mukeshkannan-Nplus
Copy link

the method does not work when u open an game and then comeback to the application it throws the same exception

@patedit
Copy link
Contributor

patedit commented Sep 12, 2016

@GreenDeveloperMukesh What's the SDK version you are using? Could you provide an stack trace and how to reproduce your issue?

@Mukeshkannan-Nplus
Copy link

Mukeshkannan-Nplus commented Sep 13, 2016

@AamirAbro
Copy link

I am also seeing a similar crash in the wild, mixpanel version is 5.0.0 and proguard is on.
Let me know if you need more details.

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{<appPackage>/<appPackage>.<appActivity>}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.flatbuffers.helpers.FlatBufferModelHelper$LazyHolder
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
       at android.app.ActivityThread.access$1100(ActivityThread.java:229)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7325)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.flatbuffers.helpers.FlatBufferModelHelper$LazyHolder
       at android.os.Parcel.readParcelableCreator(Parcel.java:2432)
       at android.os.Parcel.readParcelable(Parcel.java:2358)
       at android.os.Parcel.readValue(Parcel.java:2264)
       at android.os.Parcel.readArrayMapInternal(Parcel.java:2614)
       at android.os.BaseBundle.unparcel(BaseBundle.java:221)
       at android.os.BaseBundle.containsKey(BaseBundle.java:269)
       at android.content.Intent.hasExtra(Intent.java:6040)
       at com.mixpanel.android.mpmetrics.MixpanelActivityLifecycleCallbacks.onActivityStarted(SourceFile:31)
       at android.app.Application.dispatchActivityStarted(Application.java:229)
       at android.app.Activity.onStart(Activity.java:1324)
       at android.support.v4.app.FragmentActivity.onStart(SourceFile:595)
       at android.support.v7.app.AppCompatActivity.onStart(SourceFile:178)
       at<appActivity>.<appBaseActivity>.onStart(SourceFile:59)
       at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1266)
       at android.app.Activity.performStart(Activity.java:6943)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3276)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
       at android.app.ActivityThread.access$1100(ActivityThread.java:229)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7325)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

@mvarnagiris
Copy link

I'm getting same issue with no proguard. BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.events.common.ActionSource

@jjchiw
Copy link

jjchiw commented Aug 17, 2017

I don't know how to reproduce it but it's the same as @mvarnagiris.... I suppose

Android 7.0 and 6.0.1

with

compile "com.mixpanel.android:mixpanel-android:5.+"

Here is the complete StackTrace

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wesmartpark.parking/com.wesmartpark.parking.SplashScreen}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.events.common.ActionSource
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.facebook.events.common.ActionSource
       at android.os.Parcel.readParcelableCreator(Parcel.java:2545)
       at android.os.Parcel.readParcelable(Parcel.java:2471)
       at android.os.Parcel.readValue(Parcel.java:2374)
       at android.os.Parcel.readArrayMapInternal(Parcel.java:2727)
       at android.os.BaseBundle.unparcel(BaseBundle.java:269)
       at android.os.BaseBundle.containsKey(BaseBundle.java:341)
       at android.content.Intent.hasExtra(Intent.java:6561)
       at com.mixpanel.android.mpmetrics.MixpanelActivityLifecycleCallbacks.onActivityStarted(MixpanelActivityLifecycleCallbacks.java:37)
       at android.app.Application.dispatchActivityStarted(Application.java:231)
       at android.app.Activity.onStart(Activity.java:1271)
       at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:595)
       at com.my.SplashScreen.onStart(SplashScreen.java:254)
       at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1256)
       at android.app.Activity.performStart(Activity.java:6972)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2937)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
       at android.app.ActivityThread.-wrap14(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Hope this info is useful to reproduce it....

I can't reproduce it, this info are from the analytics service we use to track app exceptions.

:)

@patedit
Copy link
Contributor

patedit commented Sep 1, 2017

It seems that Facebook is messing with us, developers that rely on good practices. This issue has affected projects like firefox or chromium and I've sent a PR #483
Thanks for reporting this!

@seviu
Copy link

seviu commented Oct 24, 2017

It is a missing enum in the facebook android sdk, which can only be handled in the app. I have a 'fix' for it:
https://github.com/seviu/facebook-android-sdk

Basicaly create an enum com.facebook.events.common.ActionSource with the following implementation:

`package com.facebook.events.common;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

public enum ActionSource implements Parcelable {
UNKNOWN(0),
PERMALINK(1),
DASHBOARD(2),
NEWSFEED(3),
GROUP(4),
PAGE(5),
TIMELINE(22),
NOTIFICATION(29),
GRAPH_SEARCH(70),
LAUNCHER(78),
PAGE_UPCOMING_EVENTS_CARD(98),
MOBILE_SUGGESTIONS_DASHBOARD(201),
MOBILE_SUGGESTIONS_LIST(202),
MOBILE_EVENT_COMPOSER(203),
MOBILE_BOOKMARK_TAB(206),
MOBILE_SYSTEM_NOTIFICATION(207),
MOBILE_SUBSCRIPTIONS_DASHBOARD(208),
MOBILE_SUBSCRIPTIONS_LIST(209),
GUESTS_VIEW(400);

public static final String ACTION_REF_PARAM = "action_ref";

private final int mParamValue;

public static final Creator<ActionSource> CREATOR = new Creator<ActionSource>() {
    @Override
    public ActionSource createFromParcel(Parcel source) {
        String name = source.readString();
        return ActionSource.valueOf(name);
    }

    @Override
    public ActionSource[] newArray(int size) {
        return new ActionSource[0];
    }
};

private ActionSource(int i) {
    this.mParamValue = i;
}

public int describeContents() {
    return 0;
}

public int getParamValue() {
    return this.mParamValue;
}

public static void putActionRef(Bundle bundle, ActionSource actionSource) {
    bundle.putParcelable(ACTION_REF_PARAM, actionSource);
}

public void writeToParcel(Parcel parcel, int i) {
    String name = name();
    parcel.writeString(name);
}

}
`

@patedit
Copy link
Contributor

patedit commented Oct 24, 2017

Thanks for the tip @seviu ! This has been handled in the SDK for a while now as well :)

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

No branches or pull requests

9 participants