Android Studio升级过程中可能出现的错误

1.gradle编译完后出现了几百个error
特别是Ingoring InnerClasser attribute for an anonymous inner class这个错误,截取错误提示的一部分

Warning:Ignoring InnerClasses attribute for an anonymous inner class
this warning is that reflective operations on this class will incorrectly
Warning:Ignoring InnerClasses attribute for an anonymous inner class
associated EnclosingMethod attribute. This class was probably produced by a
solution is to recompile the class from source, using an up-to-date compiler
compiler that did not target the modern .class file format. The recommended

很验证去判断到底是什么,只知道是complie的时候出问题,排查了一下,发现原因是重复导包
解决办法是:去gradle里面移除重复的jar包

比如我的gradle里面就有

    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.facebook.fresco:fresco:0.6.0'
    compile 'com.jakewharton:butterknife:7.0.1'
    // 下面这个就是重复的包,因为这个包已经在libs文件夹下,而libs文件夹是我们已经在最开始的时候通过compile fileTree导入进来了,所以下面这句需要删除
    compile files('libs/umeng-update-v2.6.0.1.jar')

删除了最后一句 compile files(‘libs/umeng-update-v2.6.0.1.jar’)后,真机运行正常。

2.gradle的版本升级问题
每次更新Android Studio,都会提示更新gradle,最好的方式就是科学上网,在Android Studio内更新。实在不行的话,就自己去AndroidDevTools下载相应的gradle,本地更新。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值