NoClassDeFoundException-----解决的终极之道

9 篇文章 0 订阅
3 篇文章 0 订阅

自从引入了友盟分享的jar包以及各种so文件之后,我的应用就报各种的NoClassDeFoundException,刚开始的时候是报

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.umeng.socialize.d) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.

但是后来不知道怎么滴,虽然报这个错误,但是应用还能装到手机上,但是一运行就会报NoClassDeFoundException,
甚至在周六,在家躺着休息都不安心,终于潜入海中,找答案!!!!
MD!功夫不负有心人,在友盟论坛上终于找到了解决问题的办法。。。
附上链接:
http://www.cnblogs.com/yeahgis/p/4660873.html
从这个链接引向了另外一个StackOverFlow的链接:
http://stackoverflow.com/questions/27377080/after-update-of-as-to-1-0-getting-method-id-not-in-0-0xffff-65536-error-i

我的解决办法就是按照上面的解决办法设置的。。终于应用恢复正常了!!!
附上我的gradle文件

android{

 defaultConfig {
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 3
        versionName PROJECT_VERSION_NAME
        multiDexEnabled true
    }


    dexOptions {
        preDexLibraries true
        javaMaxHeapSize "4g"
        incremental true
        dexInProcess = true
    }
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}

然后让自己的Application 继承MultiDexApplication ,在清单文件里面一定要声明自己的Application

 android:name=".Profile"

当然,这里我是自己写了Application,上面链接里面,作者也说了如果自己没有写Application的解决方法。

希望能帮助到需要的童鞋,不要向我一样走弯路了。
等我把项目完成,会再写个关于分享的总结。这里面还是有坑要采的!

再附上一个深度了解的链接:
https://developer.android.com/studio/build/multidex.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值