简体   繁体   中英

Parcelable error in a signed android app on flutter

I'm using the Flutter in my app and I've developed a library to connect with Samsung health, I've managed to make it work properly in development mode, but after signing my app I'm getting the following error:

03-04 02:46:48.397  9137 27937 E Parcel  : Class not found when unmarshalling: d.f.a.a.b.b.k.a
03-04 02:46:48.397  9137 27937 E Parcel  : java.lang.ClassNotFoundException: d.f.a.a.b.b.k.a
03-04 02:46:48.397  9137 27937 E Parcel  :  at java.lang.Class.classForName(Native Method)
03-04 02:46:48.397  9137 27937 E Parcel  :  at java.lang.Class.forName(Class.java:453)
03-04 02:46:48.397  9137 27937 E Parcel  :  at android.os.Parcel.readParcelableCreator(Parcel.java:2827)
03-04 02:46:48.397  9137 27937 E Parcel  :  at android.os.Parcel.readParcelable(Parcel.java:2781)
03-04 02:46:48.397  9137 27937 E Parcel  :  at com.samsung.android.sdk.internal.healthdata.ReadRequestImpl.<init>(ReadRequestImpl.java:87)
03-04 02:46:48.397  9137 27937 E Parcel  :  at com.samsung.android.sdk.internal.healthdata.ReadRequestImpl$1.createFromParcel(ReadRequestImpl.java:2133)
03-04 02:46:48.397  9137 27937 E Parcel  :  at com.samsung.android.sdk.healthdata.IDataResolver$Stub.onTransact(IDataResolver.java:165)
03-04 02:46:48.397  9137 27937 E Parcel  :  at android.os.Binder.execTransact(Binder.java:739)
03-04 02:46:48.397  9137 27937 E Parcel  : Caused by: java.lang.ClassNotFoundException: Didn't find class "d.f.a.a.b.b.k.a" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.sec.android.app.shealth-3hdi_DHJ3i242E0Cxexubw==/base.apk"],nativeLibraryDirectories=[/data/app/com.sec.android.app.shealth-3hdi_DHJ3i242E0Cxexubw==/lib/arm, /data/app/com.sec.android.app.shealth-3hdi_DHJ3i242E0Cxexubw==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
03-04 02:46:48.397  9137 27937 E Parcel  :  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
03-04 02:46:48.397  9137 27937 E Parcel  :  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
03-04 02:46:48.397  9137 27937 E Parcel  :  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-04 02:46:48.397  9137 27937 E Parcel  :  ... 8 more
03-04 02:46:48.398  6604  6604 E StepCounterReader: Getting daily step trend fails.
03-04 02:46:48.398  6604  6604 E StepCounterReader: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: d.f.a.a.b.b.k.a

I have this error signing my app using flutter build apk --release

May you have used proguard.

Insert bellow rules in proguard-rules.pro

-keep class io.flutter.app.** { ; }
-keep class io.flutter.plugin.* { ; }
-keep class io.flutter.util.* { ; }
-keep class io.flutter.view.* { ; }
-keep class io.flutter.* { ; }
-keep class io.flutter.plugins.* { *; }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM