Ignoring InnerClasses attribute for an anonymous inner class

本文介绍如何解决在Android Studio中构建项目时遇到的关于匿名内部类的警告问题,并提供了一种通过修改Gradle配置文件来忽略这些警告的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(cn.bmob.v3.util.Tempest) 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.

解决办法如下:
在app下的build.gradle-->android{}中 添加
lintOptions {
    //lint 遇到 error 时继续 构建
    abortOnError false
    //build release 版本 时 开启lint 检测
    checkReleaseBuilds false
    // 防止在发布的时候出现因MissingTranslation导致Build Failed!
    disable 'MissingTranslation'
}

原因网上很多,Android Studio的代码规范比Eclipse要严格好多,所以很多第三方不是很好的支持Android Studio规范,只需要在release时忽略这些警告。还有就是Android Studio的混淆规则也要严格很多,所以要完善混淆文件


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值