使用log4j更新Android Studio后,在gradle构建中出现错误 [英] Error in gradle build after updating Android Studio with log4j

查看:2493
本文介绍了使用log4j更新Android Studio后,在gradle构建中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 错误:warning:忽略InnerClasses属性为匿名内部类
错误:(org.apache.log4j.chainsaw.ControlPanel $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 2)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 3)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 4)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 5)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:而不指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 6)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.ControlPanel $ 7)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.Main $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.chainsaw.MyTableModel $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.util.LogFileParser $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LF5SwingUtils $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 1)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 10)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 11)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 12)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 13)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 14)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 15)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 16)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:而不指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 17)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 18)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 19)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 2)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 20)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 21)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 22)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 23)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 24)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 25)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 26)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 27)不附带
错误:关联EnclosingMethod属性。这个类可能是由
生成的错误:编译器没有定位到现代的.class文件格式。推荐的
错误:解决方案是从源代码重新编译类,使用最新的编译器
错误:没有指定任何-target类型选项。忽略
的后果错误:此警告是这个类的反射操作将不正确
错误:表示它是*不*内部类。
错误:警告:忽略匿名内部类的InnerClasses属性
错误:(org.apache.log4j.lf5.viewer.LogBrokerMonitor $ 28)不附带
错误:关联EnclosingMethod属性。这个课程可能是由

安装的SDK生成的:



所有包括rev。 25.1.2



Android Studio:



Android Studio 2.0
Build#AI-143.2739321,built 2016年4月5日
JRE:1.7.0_80-b15 amd64



项目的build.gradle文件:

 应用插件:'com.android.application'

android {

签名配置{
mulco {
storeFile文件(somePath)
storePassword...
keyAlias...
keyPassword...
}


compileSdkVersion 22
buildToolsVersion22.0.1

def versionPropertiesFile = file('version.properties')
if(versionPropertiesFile.canRead ()){
def属性versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropertiesFile))
def code = versionProps ['VERSION_CODE'] toInteger()+ 1
versionProps ['VERSION_CODE'] = code.toString()
println('count version up'+ code.toString())
versionProps.store(versionPropertiesFile.newWriter(),null)

defaultConfig {
multiDexEnabled true
签名配置signatureConfigs.mulco
applicationIdcom.test.mulcoandroid
minSdkVersion 19
targetSdkVersion 22
versionCode代码
versionName1.03.01
}
} else {
throw new GradleException(无法读取version.properties!)
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),' proguard-rules.pro'
签名配置signConfigs.mulco
}
调试{
debuggable true
签名配置signConfigs.mulco
}
}
packagingOptions {
exclude'META-INF / LICENSE.txt'
exclude'META-INF / NOTICE.txt'
}
}

依赖关系{
编译fileTree(dir:'lib s',include:['* .jar'])
compile'c​​om.google.android.gms:play-services-maps:8.4.0'
compile project(':iCommonLibrary')
编译项目(':mulcobluetooth')
编译项目(':iScannerLibrary')
编译项目(':iPictureLibrary')
编译'com.android.support:multidex:1.0
testCompilejunit:junit:4.12
compile'net.lingala.zip4j:zip4j:1.3.2'
}
/ pre>

和依赖的iCommonLibrary:

 应用插件: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion22.0.1

defaultConfig {
multiDexEnabled true
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard- rules.pro'
}
}

packagingOptions {
exclude'META-INF / LICENSE.txt'
exclude'META-INF / NOTICE。 txt'
}
}

依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile'c​​om.squareup.okhttp:okhttp:2.5.0'
compile'de.greenrobot:greendao:1.3.7'
编译'commons-io:commons-io:2.4'
compile'org.apache.commons:commons-lang3:3.3.2'
compile'c​​ommons-codec:commons-codec:1.10'
compile'de.mindpipe.android:android-logging-log4j:1.0.3'
compile'org.slf4j:slf4j-api:1.6.4'
compile'org.slf4j:slf4j -log4j12:1.6.4'
compile'c​​om.google.android.gms:play-services-location:8.4.0'
compile'c​​ommons-net:commons-net:3.3'
compile'c​​om.jjoe64:graphview:4.0.1'
compile'c​​om.android.support:support-annotations:2 2.0.1'
}

iPictureLibrary的build.gradle:

 应用插件:'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion 22.0.1

defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}


依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile'it.sephiroth.android.library.horizo​​ntallistview: hlistview:1.2.2'
compile'c​​om.android.support:appcompat-v7:22.2.0'
compile'c​​om.jakewharton:disklrucache:2.0.2'
compile project(' :iCommonLibrary')
}

iScannerLibrary的build.gradle:

 应用插件:'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion22.0。 1

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}

依赖关系{
compile fileTree(dir:'libs',include:['* .jar'])
编译'com.google.zxing:core:3.2.1'
编译'com.google.zxing:android-core:3.2.1'
编译文件('libs / GrabbaSDK / Grabba driver for android v1.122.jar')
compile project ':iCommonLibrary')
}

mulcobluetooth的build.gradle文件:

 应用插件:'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion22.0.1

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}

defaultConfig
{
multiDexEnabled true
}
}

依赖关系{
compile fileTree(dir: 'libs',包括:['* .jar'])
compile'org.apache.commons:commons-lang3:3.3.2'
compile'c​​ommons-io:commons-io:2.4'
}

希望我提供任何重要信息 p>

如果有人知道什么...请帮助我!我在这个NEULAND中找不到任何东西



对于长时间的问题,对不起,谢谢任何已经完成这个的人。



编辑:



我将依赖项更新为:

  compile'org.apache.logging.log4j:log4j-core:2.5'
compile'org.slf4j:slf4j-api:1.7.21'
编译'org.slf4j:slf4j-log4j12:1.7.21'

但没有任何变化。我仍然有大约500个构建错误....我删除了管道作为参考编码它自己...没有发生!



编辑:



打开机票:问题206867



https://code.google.com/p/android/issues/detail?id=206867



编辑:



卸载Android Studio 2.0并再次安装1.5.1后,我会收到以下警告:



警告:需要Gradle版本2.10。当前版本是2.8。如果使用渐变包装,请尝试在C:\Sources\iRecyApps\iRecyMulco-1.0.1iOS\gradle\wrapper\gradle-wrapper.properties中将distributionUrl编辑为gradle-2.10-all.zip



所以gradle版本更新了2 ...



我通知了自己现在的毕业版本,它是2.12



我下载了这两个文件:



您需要更改文件>设置>构建,执行,部署>构建工具> Gradle> Gradle home路径



在Mac OS中,更改Android Studio中的路径>首选项>构建,执行,部署>构建工具> Gradle> Gradle home



或设置使用默认渐变包装并编辑Project\gradle\wrapper\gradle-wrapper.properties文件字段distributionUrl像这样



根据:



Gradle Version 2.10 is re quired"。错误



http://tools.android.com/tech-docs/new-build-system/version兼容性



仍然没有

解决方案

将此行添加到proguard-rules.pro

  -keepattributes EnclosingMethod 






这个错误可能发生在几乎所有有内容类的类,我想。
(如support.v4等)为我。






我已经测试过
Android studio 2.2

(未测试的log4j。测试的support.v4等)



build.gradle

  compileSdkVersion 24 
buildToolsVersion24.0.2
...
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
...
依赖关系{
...
compile'c​​om.android.support: support-v4:24.2.1'
}






getDefaultProguardFile('proguard-android-optimize.txt')也可以使用。


I do get these errors after i updated Android Studio and the SDK:

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$2) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$3) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$4) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$5) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$6) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$7) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.Main$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.MyTableModel$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.util.LogFileParser$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LF5SwingUtils$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$1) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$10) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$11) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$12) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$13) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$14) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$15) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$16) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$17) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$18) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$19) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$2) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$20) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$21) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$22) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$23) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$24) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$25) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$26) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$27) 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.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.lf5.viewer.LogBrokerMonitor$28) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a

Installed SDK:

All including rev. 25.1.2

Android Studio:

Android Studio 2.0 Build #AI-143.2739321, built on April 5, 2016 JRE: 1.7.0_80-b15 amd64

The build.gradle file of the project:

apply plugin: 'com.android.application'

android {

signingConfigs {
    mulco {
        storeFile file("somePath")
        storePassword "..."
        keyAlias "..."
        keyPassword "..."
    }
}

compileSdkVersion 22
buildToolsVersion "22.0.1"

def versionPropertiesFile = file('version.properties')
if (versionPropertiesFile.canRead()) {
    def Properties versionProps = new Properties()
    versionProps.load(new FileInputStream(versionPropertiesFile))
    def code = versionProps['VERSION_CODE'].toInteger() + 1
    versionProps['VERSION_CODE'] = code.toString()
    println('count version up ' + code.toString())
    versionProps.store(versionPropertiesFile.newWriter(), null)

    defaultConfig {
        multiDexEnabled true
        signingConfig signingConfigs.mulco
        applicationId "com.test.mulcoandroid"
        minSdkVersion 19
        targetSdkVersion 22
        versionCode code
        versionName "1.03.01"
    }
} else {
    throw new GradleException("Could not read version.properties!")
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.mulco
    }
    debug {
        debuggable true
        signingConfig signingConfigs.mulco
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services-maps:8.4.0'
    compile project(':iCommonLibrary')
    compile project(':mulcobluetooth')
    compile project(':iScannerLibrary')
    compile project(':iPictureLibrary')
    compile 'com.android.support:multidex:1.0.1'
    testCompile "junit:junit:4.12"
    compile 'net.lingala.zip4j:zip4j:1.3.2'
}

and of the dependant iCommonLibrary:

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    multiDexEnabled true
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'de.greenrobot:greendao:1.3.7'
    compile 'commons-io:commons-io:2.4'
    compile 'org.apache.commons:commons-lang3:3.3.2'
    compile 'commons-codec:commons-codec:1.10'
    compile 'de.mindpipe.android:android-logging-log4j:1.0.3'
    compile 'org.slf4j:slf4j-api:1.6.4'
    compile 'org.slf4j:slf4j-log4j12:1.6.4'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'commons-net:commons-net:3.3'
    compile 'com.jjoe64:graphview:4.0.1'
    compile 'com.android.support:support-annotations:22.0.1'
}

build.gradle of iPictureLibrary:

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 19
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'it.sephiroth.android.library.horizontallistview:hlistview:1.2.2'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.jakewharton:disklrucache:2.0.2'
    compile project(':iCommonLibrary')
}

build.gradle of iScannerLibrary:

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.zxing:core:3.2.1'
    compile 'com.google.zxing:android-core:3.2.1'
    compile files('libs/GrabbaSDK/Grabba driver for android v1.122.jar')
    compile project(':iCommonLibrary')
}

build.gradle file of mulcobluetooth:

apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

defaultConfig
{
    multiDexEnabled true
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'org.apache.commons:commons-lang3:3.3.2'
    compile 'commons-io:commons-io:2.4'
}

I hope i provided any important information

If someone does know anything ... please help me! I cannot find anything in this "NEULAND"

Sorry for the long question... Thanks for anyone who has made it up to here.

EDIT:

I updated the dependencies to:

compile 'org.apache.logging.log4j:log4j-core:2.5'
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.slf4j:slf4j-log4j12:1.7.21'

But nothing has changed. I still have about 500 build errors .... I deleted mindpipe as reference an coded it by myself ... Nothing happened!

EDIT:

Opened a ticket: Issue 206867

https://code.google.com/p/android/issues/detail?id=206867

EDIT:

After uninstall Android Studio 2.0 and install 1.5.1 again I get the following warning:

Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:\Sources\iRecyApps\iRecyMulco-1.0.1iOS\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip

So the gradle version was updated by 2...

I informed myself about the current gradle version and it's 2.12

I downloaded both and tried this:

You need to change File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path

On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home

Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this

according to:

"Gradle Version 2.10 is required." Error

http://tools.android.com/tech-docs/new-build-system/version-compatibility

Still nothing

解决方案

Add this line to proguard-rules.pro

-keepattributes EnclosingMethod


This error may happen almost all classes which has InnerClasses, I think. (like support.v4 etc) for me.


I've tested on Android studio 2.2
(Not tested log4j. Tested support.v4 etc.)

build.gradle

compileSdkVersion 24
buildToolsVersion "24.0.2"
...
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
...
dependencies {
    ...
    compile 'com.android.support:support-v4:24.2.1'
}


getDefaultProguardFile('proguard-android-optimize.txt') also works.

这篇关于使用log4j更新Android Studio后,在gradle构建中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆