android项目迁移核心问题

哈哈!第一次写博客还有点小激动啊!今天我要讲的内容能帮助到到大家一点,由于13年google推出我们安卓开发专用的IDE,市场上安卓项目都开始从eclipse转向Android studio,我们也不例外,但我通过一天迁移项目发现很多细节问题,项目过大报65533问题,导入jar版本问题,后来考虑到项目上线的性能,还是重新重构项目也没花多长时间就搞定,当编译SUCCESS后,激动的你以为已经成功,其实不然,真机运行报了一个很严重的错误:


AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"error","text":"(com.baidu.location.b) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]}
AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"error","text":"(com.baidu.location.c) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}

刚开始一定以为是导入的jar有问题,删除相同jar包或者以为是百度定位服务不是最新的jar,在我一一试过后还是包这错误就很郁闷,看了很多资料也走了弯路,正确的解决方法

导入

com.android.support:multidex包
 
 
在你的Application中调用这个方法

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(mApplication);
}
原来到头来还是你的项目过大,早知道就能早解决,今天希望大家看过我的博客朋友,能少走点弯路。

猜你喜欢

转载自blog.csdn.net/qq_30423365/article/details/60572914