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
java.lang.NoClassDefFoundError: cn.jiajixin.nuwa.Hack #16
Comments
@liericiyan 看一下readme里,nuwa DSL的说明 |
不好意思,nuwa DSL的说明 我看不太明白 |
nuwa{ 把这个加在apply plugin 'cn.jiajixin.nuwa'的后面 |
Sorry,It's useless!build.gradle }The error log is: at dalvik.system.NativeStart.main(Native Method)The code is : |
@liericiyan |
延迟加载解决了这个问题,感谢! |
请问加载patch.jar时出现时,在BaseApplication初始化的时候出现 |
@JakeWoki 我试了试nuwa的sample是可以的,然后我加入了一个baseApplication 让NuwaApplication继承之,然后运行就会出现Hack类找不到的情况,你的什么情况? |
@gondole 你不会忘了加权限吧,我遇到个盆友就是忘了加权限(・・) <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
@gondole 不知道这算不算个bug,出现这个问题是因为插件将你BaseApplication的构造方法里插入了 Class cls = Hack.class; 所以你应该将这个类排除在外 |
@gondole 不用继承nuwaApplication,nuwaApplication没什么东西在里面,我项目Application本来就继承了别的 |
@gondole 如果excludeClass = ['BaseApplication.class'] 不能用的话,那么就不要混淆BaseApplication这个类 |
@gondole 因为作者是将打包后的jar包拿出来进行处理,这个时候已经是混淆的了,BaseApplication有可能已经变了名字比如a.class 这时候excludeClass的hashset里找不到a.class |
@JakeWoki 写在apply plugin之后 apply plugin: "cn.jiajixin.nuwa"
nuwa{
excludeClass = ['BaseApplication.class']
} |
@JakeWoki 虽然看不出为啥,但com/activeandroid/content/ContentProvider.class 这个类应该被注入了hack.class了,ContentProvider类,你去掉混淆没 |
@JakeWoki 可以试试另一个Andfix开源热修复,不需要重启app,addpatch之后立即生效 |
@dodola |
application继承的是MultiDexApplication,内部使用了静态变量okhttp 声明: public static final OkHttpClient client = new OkHttpClient();
然后就报错了
The text was updated successfully, but these errors were encountered: