运行时候出现问题Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

在写demo的时候出现了Error:warning: Ignoring InnerClasses attribute for an anonymous inner class等24个错误,上网查了一些方法,最终使用这个方法解决了,记录一下,方便大家以及自己今后参考:

具体报的错误是:

运行时候出现问题Error:warning: Ignoring InnerClasses attribute for an anonymous inner class_第1张图片

这类问题的出现具体原因是android sdk tools版本过低导致,我之前由于Android studio 导入过一些版本较低的项目,重新下载了几个sdk,之后再运行就出现了这个问题,上网查说是android sdk tools版本过低的问题

我解决的方法是在Android下的app的build.gradle(Module:app)的文件下内容是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.jinyuankeji.yxm.gdlocationdemo"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
      
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
   
}

然后在proguard-rules.pro文件下添加一句代码:
-keepattributes EnclosingMethod


希望以上总结的能够帮助到大家,还是菜鸟一只,如果有错误之处还请各路大神帮忙指出,不胜感激~~~

 


你可能感兴趣的:(运行时候出现问题Error:warning: Ignoring InnerClasses attribute for an anonymous inner class)