yugai/MVPPlugin

混淆出错。。。求混淆方法

Closed this issue · 6 comments

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.erp.inventorymachine/com.erp.inventorymachine.ui.activity.main.MainActivity}: java.lang.ClassCastException: java.lang.Object cannot be cast to com.erp.inventorymachine.mvp.BasePresenterImpl
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2214)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
at android.app.ActivityThread.access$600(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5136)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to com.erp.inventorymachine.mvp.BasePresenterImpl
at com.erp.inventorymachine.mvp.MVPBaseActivity.onCreate(MVPBaseActivity.java:23)
at com.erp.inventorymachine.ui.activity.main.MainActivity.onCreate(MainActivity.java:39)
at android.app.Activity.performCreate(Activity.java:5133)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2178)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264) 
at android.app.ActivityThread.access$600(ActivityThread.java:144) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:5136) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
at dalvik.system.NativeStart.main(Native Method) 

yugai commented

#7 你的混淆配置是不是有什么问题。

之前没加泛型
-keepattributes Signature

然而加上去也没啥用,一样的报错

-keepclasseswithmembernames class com.erp.inventorymachine.mvp.**{*;}
这样也不行 ,一样的报错信息,

yugai commented

-keep public class * extends [包名].BasePresenter

-keep public class * extends [包名].mvp.BasePresenter
说包名很容易漏掉mvp这个路径。。。。。。