Prototik / HoloEverywhere

NO LONGER MAINTAINED. DEVELOP FOR 4.X+ DUDE.
MIT License
2.18k stars 607 forks source link

Class not found when unmarshalling #643

Closed renaudcerrato closed 11 years ago

renaudcerrato commented 11 years ago

Using MapView (maps v2) in holoeverywhere fragments. The custom parcelable cannot be found onto the remote process when calling "mapview.onCreate(savedInstanceState)" :

E/AndroidRuntime( 5224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.foo/com.test.foo.ui.ViewEventActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: org.holoeverywhere.widget.ProgressBar$SavedState
E/AndroidRuntime( 5224): Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: org.holoeverywhere.widget.ProgressBar$SavedState
E/AndroidRuntime( 5224):    at android.os.Parcel.readParcelableCreator(Parcel.java:2105)
E/AndroidRuntime( 5224):    at android.os.Parcel.readParcelable(Parcel.java:2055)
E/AndroidRuntime( 5224):    at android.os.Parcel.readValue(Parcel.java:1971)
E/AndroidRuntime( 5224):    at android.os.Parcel.readSparseArrayInternal(Parcel.java:2284)
E/AndroidRuntime( 5224):    at android.os.Parcel.readSparseArray(Parcel.java:1693)
E/AndroidRuntime( 5224):    at android.os.Parcel.readValue(Parcel.java:2028)
E/AndroidRuntime( 5224):    at android.os.Parcel.readMapInternal(Parcel.java:2255)
E/Parcel  ( 8629): Class not found when unmarshalling: org.holoeverywhere.widget.ProgressBar$SavedState
E/Parcel  ( 8629): java.lang.ClassNotFoundException: org.holoeverywhere.widget.ProgressBar$SavedState
E/Parcel  ( 8629):  at java.lang.Class.classForName(Native Method)
E/Parcel  ( 8629):  at java.lang.Class.forName(Class.java:204)
E/Parcel  ( 8629):  at android.os.Parcel.readParcelableCreator(Parcel.java:2091)
E/Parcel  ( 8629):  at android.os.Parcel.readParcelable(Parcel.java:2055)
E/Parcel  ( 8629):  at android.os.Parcel.readValue(Parcel.java:1971)
E/Parcel  ( 8629):  at android.os.Parcel.readSparseArrayInternal(Parcel.java:2284)
E/Parcel  ( 8629):  at android.os.Parcel.readSparseArray(Parcel.java:1693)
E/Parcel  ( 8629):  at android.os.Parcel.readValue(Parcel.java:2028)
E/Parcel  ( 8629):  at android.os.Parcel.readMapInternal(Parcel.java:2255)
E/Parcel  ( 8629):  at android.os.Bundle.unparcel(Bundle.java:223)
E/Parcel  ( 8629):  at android.os.Bundle.getBundle(Bundle.java:1148)
E/Parcel  ( 8629):  at bpq.a(SourceFile:74)
E/Parcel  ( 8629):  at maps.ag.an.a(Unknown Source)
E/Parcel  ( 8629):  at maps.ag.bk.a(Unknown Source)
E/Parcel  ( 8629):  at boe.onTransact(SourceFile:66)
E/Parcel  ( 8629):  at android.os.Binder.transact(Binder.java:347)
E/Parcel  ( 8629):  at com.google.android.gms.maps.internal.IMapViewDelegate$a$a.onCreate(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.maps.MapView$a.onCreate(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.dynamic.a$3.b(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.dynamic.a$1.a(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.maps.MapView$b.bi(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.maps.MapView$b.a(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.dynamic.a.a(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.dynamic.a.onCreate(Unknown Source)
E/Parcel  ( 8629):  at com.google.android.gms.maps.MapView.onCreate(Unknown Source)
E/Parcel  ( 8629):  at com.test.foo.view.EventView.onCreate(EventView.java:234)
E/Parcel  ( 8629):  at com.test.foo.ui.ViewEventFragment.onCreateView(ViewEventFragment.java:49)
E/Parcel  ( 8629):  at android.support.v4.app._HoloFragment.onCreateView(_HoloFragment.java:173)
E/Parcel  ( 8629):  at android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)
E/Parcel  ( 8629):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:900)
E/Parcel  ( 8629):  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
E/Parcel  ( 8629):  at android.support.v4.app._HoloFragmentInflater.inflate(_HoloFragmentInflater.java:66)
E/Parcel  ( 8629):  at android.support.v4.app._HoloFragmentInflater.inflate(_HoloFragmentInflater.java:85)
E/Parcel  ( 8629):  at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:428)
E/Parcel  ( 8629):  at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:529)
E/Parcel  ( 8629):  at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:488)
E/Parcel  ( 8629):  at android.support.v4.app._HoloActivity.requestDecorView(_HoloActivity.java:580)
E/Parcel  ( 8629):  at android.support.v4.app._HoloActivity.setContentView(_HoloActivity.java:604)
E/Parcel  ( 8629):  at com.test.foo.ui.ViewEventActivity.onCreate(ViewEventActivity.java:20)
E/Parcel  ( 8629):  at android.app.Activity.performCreate(Activity.java:5133)
E/Parcel  ( 8629):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/Parcel  ( 8629):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
E/Parcel  ( 8629):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E/Parcel  ( 8629):  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3740)
E/Parcel  ( 8629):  at android.app.ActivityThread.access$700(ActivityThread.java:141)
E/Parcel  ( 8629):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1262)
E/Parcel  ( 8629):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/Parcel  ( 8629):  at android.os.Looper.loop(Looper.java:137)
E/Parcel  ( 8629):  at android.app.ActivityThread.main(ActivityThread.java:5103)
E/Parcel  ( 8629):  at java.lang.reflect.Method.invokeNative(Native Method)
E/Parcel  ( 8629):  at java.lang.reflect.Method.invoke(Method.java:525)
E/Parcel  ( 8629):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/Parcel  ( 8629):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/Parcel  ( 8629):  at dalvik.system.NativeStart.main(Native Method)
E/Parcel  ( 8629): Caused by: java.lang.NoClassDefFoundError: org/holoeverywhere/widget/ProgressBar$SavedState
E/Parcel  ( 8629):  ... 54 more
E/Parcel  ( 8629): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.holoeverywhere.widget.ProgressBar$SavedState" on path: DexPathList[[zip file "/system/framework/com.android.location.provider.jar", zip file "/data/app/com.google.android.gms-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.google.android.gms-2, /vendor/lib, /syst
E/AndroidRuntime( 8629): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.foo/com.test.foo.ui.ViewEventActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: org.holoeverywhere.widget.ProgressBar$SavedState
E/AndroidRuntime( 8629): Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: org.holoeverywhere.widget.ProgressBar$SavedState
E/AndroidRuntime( 8629):    at android.os.Parcel.readParcelableCreator(Parcel.java:2105)
E/AndroidRuntime( 8629):    at android.os.Parcel.readParcelable(Parcel.java:2055)
E/AndroidRuntime( 8629):    at android.os.Parcel.readValue(Parcel.java:1971)
E/AndroidRuntime( 8629):    at android.os.Parcel.readSparseArrayInternal(Parcel.java:2284)
E/AndroidRuntime( 8629):    at android.os.Parcel.readSparseArray(Parcel.java:1693)
E/AndroidRuntime( 8629):    at android.os.Parcel.readValue(Parcel.java:2028)
E/AndroidRuntime( 8629):    at android.os.Parcel.readMapInternal(Parcel.java:2255)
Prototik commented 11 years ago

Android bug. Also i'm haven't ability to modify standard gms library, not library issue.

renaudcerrato commented 11 years ago

That's probably because you're using a custom parcelable... Can it be avoided?

For now, I'm using the following workaround:

@Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);

        Bundle gmapstate = new Bundle();
        mMapView.onSaveInstanceState(gmapstate);
        outState.putParcelable("gmap_state", gmapstate);
Prototik commented 11 years ago

Yes, i'm using a custom parcelable, and i have no way more for saving state of widgets. Android cannot find class in system classloader, gms doesn't provide a application-level classloader to

bpq.a(SourceFile:74)

You can submit bug in google support or devs list.