2017-11-03 13 views
1

突然、アプリケーションの実行中にエラーが発生しました。 私はこのqustionはすでにここに頼まれたことを知っている:Annotation processors must be explicitly declared nowエラー注釈プロセッサを明示的に宣言する必要があります

をソリューションは、問題に答えていません。しかし:(

を、これは誰もがどのようにこのエラーことができます知っている

apply plugin: 'com.android.application' 
apply plugin: 'kotlin-android' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '27.0.0' 
    aaptOptions { 
     cruncherEnabled = true 
    } 
    defaultConfig { 
     applicationId "com.freelance.crdzbird_dev.clarobadge" 
     minSdkVersion 19 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     renderscriptTargetApi 22 
     renderscriptSupportModeEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled true 
      shrinkResources true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE' 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 
    compile 'com.android.support:appcompat-v7:26.+'  
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:design:26.+' 
    compile 'com.android.support:support-v4:26.+' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.github.javiersantos:MaterialStyledDialogs:2.1' 
    annotationProcessor 'com.google.auto.value:auto-value:1.1' 
    compile 'ai.api:libai:1.4.8' 
    compile 'ai.api:sdk:[email protected]' 
    compile 'de.greenrobot:eventbus:2.4.0' 
    compile 'io.mattcarroll.hover:hover:0.9.8' 
    compile 'com.gjiazhe:MultiChoicesCircleButton:1.0' 
    compile "org.apache.logging.log4j:log4j-core:2.8" 
    compile 'com.sackcentury:shinebutton:0.1.9' 
    compile 'com.yalantis:contextmenu:1.0.7' 
    compile 'com.squareup.retrofit2:retrofit:2.3.0' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    compile 'com.android.support:recyclerview-v7:26.0.0-alpha1' 
    compile 'com.android.support:cardview-v7:26.0.0-alpha1' 
    compile 'com.google.android.gms:play-services-maps:11.0.4' 
    compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.2' 
    compile 'me.samthompson:bubble-actions:1.3.0' 
    compile 'com.google.android.gms:play-services:11.0.4' 
    compile 'com.github.apl-devs:appintro:v4.2.2' 
    compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' 
    compile 'com.google.firebase:firebase-messaging:10.2.1' 
    testCompile 'junit:junit:4.12' 
} 

apply plugin: 'com.google.gms.google-services' 
repositories { 
    mavenCentral() 

私のbuild.gradleです私は成功せず、グーグルで検索します。解決される。

これは

Error:Execution failed for task ':app:javaPreCompileDebug'. 
> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration. 
    - log4j-core-2.8.jar (org.apache.logging.log4j:log4j-core:2.8) 
    Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future. 
    See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details. 
を受け取るエラーです
+0

咳咳咳... 'log4jのコア・2.8'に依存しているあなたの依存関係のかを調べます。それらの依存関係の開発者に連絡して、 'log4j-core-2.8'の使用を修正するよう依頼してください。そして、その間に、モジュールの 'build.gradle'ファイルで' android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true'を設定してください。 – CommonsWare

+1

@CommonsWare推移的であるとお考えですか?彼が明らかにlog4jを引っ張っているようだ。 – Michael

+1

@Michael:ああ、そうです - 私は依存関係の海を失い、それを見逃しました。ごめんなさい! – CommonsWare

答えて

3

ユーザーのエラーはこの注釈プロセッサがauto-value-1.1.jar (com.google.auto.value:auto-value:1.1)を行方不明になったと述べ、そして答えは追加することだったこと:

annotationProcessor 'com.google.auto.value:auto-value:1.1' 

あなたのエラーがlog4j-core-2.8.jar (org.apache.logging.log4j:log4j-core:2.8)ので、あなたは答えはこれを追加することだと思ったと言いますか?

annotationProcessor 'com.google.auto.value:auto-value:1.1' 

これをそのままコピーしました。もちろんそれは動作しません!注釈プロセッサを実際に使用しているものに変更します。


カフオフannotationProcessor 'org.apache.logging.log4j:log4j-core:2.8'

+0

実際にannotationProcessorの 'org.apache.logging.log4j:log4j-core:2.8'が私が追加した最初のものでしたが、ここではうまくいきますhttps://github.com/groovy/groovy-android-gradle-plugin/ Apacheのログにはいくつかの問題がありますので、最も良い方法は、2.3.3にgradleの依存関係をダウングレードしています –

+0

あなたは逆向きに移動したようですね。バグが解決されるまで旧バージョンのGradleを使用してみませんか? – Michael

+0

これは最良の代替テンポラリーでした –

関連する問題