luckybilly / CC

业界首个支持渐进式组件化改造的Android组件化开源框架,支持跨进程调用。Componentize your android project gradually.
https://luckybilly.github.io/CC-website/
Apache License 2.0
4.05k stars 635 forks source link

使用CC框架debug版本正常,编译release版本运行报以下错误,请验证 #72

Closed exhange closed 5 years ago

exhange commented 6 years ago

2018-10-27 17:44:04.323 16844-16844/? E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist! 2018-10-27 17:44:04.379 16844-16868/? E/Parcel: Class not found when unmarshalling: com.billy.cc.core.component.remote.BinderWrapper java.lang.ClassNotFoundException: com.billy.cc.core.component.remote.BinderWrapper at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:453) at android.os.Parcel.readParcelableCreator(Parcel.java:2822) at android.os.Parcel.readParcelable(Parcel.java:2776) at android.os.Parcel.readValue(Parcel.java:2679) at android.os.Parcel.readArrayMapInternal(Parcel.java:3046) at android.os.BaseBundle.unparcel(BaseBundle.java:257) at android.os.Bundle.getParcelable(Bundle.java:888) at com.billy.cc.core.component.remote.g.a(Unknown Source:19) at com.billy.cc.core.component.r.g(Unknown Source:35) at com.billy.cc.core.component.r.d(Unknown Source:29) at com.billy.cc.core.component.q.a(Unknown Source:16) at com.billy.cc.core.component.q$a.run(Unknown Source:4) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:784) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.billy.cc.core.component.remote.BinderWrapper" on path: DexPathList[[zip file "/data/app/com.finest.app.test-PTITXuX67Yc8hi0erjarEw==/base.apk"],nativeLibraryDirectories=[/data/app/com.finest.app.test-PTITXuX67Yc8hi0erjarEw==/lib/arm64, /data/app/com.finest.app.test-PTITXuX67Yc8hi0erjarEw==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at java.lang.Class.classForName(Native Method)  at java.lang.Class.forName(Class.java:453)  at android.os.Parcel.readParcelableCreator(Parcel.java:2822)  at android.os.Parcel.readParcelable(Parcel.java:2776)  at android.os.Parcel.readValue(Parcel.java:2679)  at android.os.Parcel.readArrayMapInternal(Parcel.java:3046)  at android.os.BaseBundle.unparcel(BaseBundle.java:257)  at android.os.Bundle.getParcelable(Bundle.java:888)  at com.billy.cc.core.component.remote.g.a(Unknown Source:19)  at com.billy.cc.core.component.r.g(Unknown Source:35)  at com.billy.cc.core.component.r.d(Unknown Source:29)  at com.billy.cc.core.component.q.a(Unknown Source:16)  at com.billy.cc.core.component.q$a.run(Unknown Source:4)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)  at java.lang.Thread.run(Thread.java:784) 

--------- beginning of crash

2018-10-27 17:44:04.382 16844-16868/? E/AndroidRuntime: FATAL EXCEPTION: cc-pool-4963 Process: com.finest.app.test, PID: 16844 android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.billy.cc.core.component.remote.BinderWrapper at android.os.Parcel.readParcelableCreator(Parcel.java:2850) at android.os.Parcel.readParcelable(Parcel.java:2776) at android.os.Parcel.readValue(Parcel.java:2679) at android.os.Parcel.readArrayMapInternal(Parcel.java:3046) at android.os.BaseBundle.unparcel(BaseBundle.java:257) at android.os.Bundle.getParcelable(Bundle.java:888) at com.billy.cc.core.component.remote.g.a(Unknown Source:19) at com.billy.cc.core.component.r.g(Unknown Source:35) at com.billy.cc.core.component.r.d(Unknown Source:29) at com.billy.cc.core.component.q.a(Unknown Source:16) at com.billy.cc.core.component.q$a.run(Unknown Source:4) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:784)

luckybilly commented 6 years ago

这是我的疏忽,需要添加一下保持Parcelable的混淆配置:

#保持实现Parcelable的类不被混淆
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}
luckybilly commented 5 years ago

@exhange 2.1.2开始不需要添加了(框架自身已添加)