web-dev-qa-db-ja.com

更新後のgradleビルドでのエラーAndroid Studio with log4j

Android Studioおよび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

インストールされたSDK:

Revを含むすべて25.1.2

Android Studio:

Android Studio 2.0ビルド#AI-143.2739321、2016年4月5日にビルドJRE:1.7.0_80-b15 AMD64

プロジェクトのbuild.gradleファイル:

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'
}

および依存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'
}

iPictureLibraryのbuild.gradle:

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')
}

iScannerLibraryのbuild.gradle:

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')
}

mulcobluetoothのbuild.gradleファイル:

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'
}

重要な情報を提供したいです

誰かが何かを知っていたら...助けてください!この「NEULAND」には何も見つかりません

長い質問でごめんなさい...ここまでやってくれた人に感謝します。

編集:

依存関係を次のように更新しました。

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'

しかし、何も変わっていません。私はまだ約500のビルドエラーがあります。

編集:

チケットを開いた:問題206867

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

編集:

Android Studio 2.0をアンインストールし、1.5.1を再度インストールすると、次の警告が表示されます。

警告:Gradleバージョン2.10が必要です。現在のバージョンは2.8です。 gradleラッパーを使用する場合は、C:\ Sources\iRecyApps\iRecyMulco-1.0.1iOS\gradle\wrapper\gradle-wrapper.propertiesのdistributionUrlをgradle-2.10-all.Zipに編集してみてください

だから、gradleバージョンは2によって更新されました...

私は現在のgradleバージョンについて自分に知らせました、それは2.12です

私は両方をダウンロードしてこれを試しました:

ファイル>設定>ビルド、実行、展開>ビルドツール> Gradle> Gradleホームパスを変更する必要があります

Mac OSでは、Android Studio> Preferences> Builds、Execution、Deployment> Build Tools> Gradle> Gradle homeでパスを変更します

または、デフォルトのGradleラッパーを使用を設定し、Project\gradle\wrapper\gradle-wrapper.propertiesファイルのフィールドdistributionUrlを次のように編集します

による:

「Gradleバージョン2.10が必要です。」エラー

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

まだ何もない

25
Spektakulatius

この行をproguard-rules.proに追加します

_-keepattributes EnclosingMethod
_

このエラーは、InnerClassesを持つほとんどすべてのクラスで発生する可能性があります。 (support.v4など)私にとって。


私はAndroid studio 2.2でテストしました
(log4jはテストされていません。support.v4などがテストされています。)

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')も機能します。

21
Toris

私もこの同じエラーに直面していました。エラーカウントが1Kを超えていたので、私は夢中になりました。そして、proguardを有効にしたリリースビルドでこれらのエラーが発生していました。

掘り下げた後、-keepattributes EnclosingMethodあなたのproguard-rules.pro fileこれらのエラーはすべてなくなります。

SourceThread および Issue#294 GitHubで。

4
activesince93

これは私のために働いた、新しいAndroidスタジオプロジェクトのコピーを開始し、エラーがあった古いプロジェクトでgradle-wrapper.propertiesとbuild.gradle(プロジェクト: "プロジェクト名")を貼り付けます-であなたのgradleをアップグレードするために

また、これをproguard-rules.proに追加します

-keepattributes EnclosingMethod

Build.gradle(Module:app)を次のように更新します

buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
        }

    }

    dexOptions {
        preDexLibraries = false
    }
0
Dina Mansour

プロジェクトのproguard-rules.proにこのコードスニペットを記述します。

-keepattributes EnclosingMethod

上記のスニペットをproguard-rules.proファイルに書き込むことにより、プロガードルールは実際にクラスの難読化方法を変更します。

0
Pankaj Lilan

Gradle構成でcom.Android.supportのすべての依存関係を23.1.1にダウングレードすることで解決しました。

0
user2153941

私の場合、Instant Run有効化、ただし無効化後Instant Run、エラーは消えました。 enter image description here

0
joe