2017-11-16 7 views
2

のために互換性のないプラグインを使用して、私は警告があります。Androidのメーカー3.0警告:3.0バージョンへのアップデートのAndroid Studioの後に注釈処理

Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead. 

を私はGradleのソースを書き換えることを試みたが、私はまだ警告を持っています。ここ はソース

buildscript { 
repositories { 
    google() 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:3.0.0' 
    classpath 'io.realm:realm-gradle-plugin:0.89.+' 
} 
} 
allprojects { 
repositories { 
    google() 
    jcenter() 
} 
} 
task clean(type: Delete) { 
delete rootProject.buildDir 
} 




apply plugin: 'com.android.application' 
android { 
compileSdkVersion 26 
defaultConfig { 
    applicationId "com.syncapp" 
    minSdkVersion 21 
    targetSdkVersion 26 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
} 

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

dependencies { 
implementation fileTree(include: ['*.jar'], dir: 'libs') 
implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
testImplementation 'junit:junit:4.11' 
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 
implementation 'com.android.support:support-v4:27.0.1' 
implementation 'com.android.support:appcompat-v7:27.0.1' 
implementation 'com.android.support:design:27.0.1' 
compile 'org.greenrobot:eventbus:3.1.1' 
compile 'com.google.code.gson:gson:2.6.2' 
compile 'com.squareup.retrofit2:retrofit:2.1.0' 
compile 'com.squareup.retrofit2:converter-gson:2.1.0' 

compile 'com.squareup.okhttp:okhttp:2.7.5' 
compile 'com.squareup.okhttp:mockwebserver:2.7.5' 

compile 'com.jakewharton:butterknife:8.8.1' 
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 

compile 'com.google.dagger:dagger:2.4' 
annotationProcessor 'com.google.dagger:dagger-compiler:2.4' 


} 
apply plugin: 'realm-android' 

であるあなたは、私のプロジェクトで、私はbutterknife、短剣、okhttp、retrofit2とeventbusサポートライブラリ

どれソリューション

を使用している見ることができるように?アプリを実行できません ありがとう

+0

あなたの 'compile'を' implementation'に変更しようとしました –

答えて

0

このlinkをご覧になりましたか?基本的には

If you are experiencing issues migrating to the new dependency resolution >strategy, you can restore behavior to that of Android plugin 2.3.0 by setting >includeCompileClasspath true.

android { 
... 
defaultConfig { 
    ... 
    javaCompileOptions { 
     annotationProcessorOptions { 
      includeCompileClasspath false 
     } 
    } 
} 
} 

は、あなたがプロジェクトクリーナーを作るためにアプトプラグインを削除することを選ぶが、それは、公式ドキュメントによる影響を及ぼすべきではないと考えることができ

android-apt plugin users: This behavior change currently does not affect the >android-apt plugin. However, the plugin will not be compatible with future >versions of the Android plugin for Gradle Also when yuo migrate to Android Studio 3.0 you should not use compile but implementation for every dependency

も何DaggerやButterknifeで作成したアノテーションプロセッサの依存関係をアップグレードまたはダウングレードしようとすると、Butterknifeを削除しようとした場合(ただし、私はそれについてはわかりませんダガー1で十分ですが、とにかく必要はありません)。

+0

gradelにjavaCompileOptionsを追加しましたが、まだproblem.anyソリューションがありますか? @ trocchietto – BekaKK

+0

@Baggioあなたは今、同じエラーになるのですか? – trocchietto

+0

ダガーとバターナイフの依存関係を更新またはダウングレードしよう! – trocchietto

1

build.gradleファイルからaptプラグインを削除します。そして、依存関係がある場合はaptannotationProcessorに置き換えてください。さらに、realm依存バージョンを4.1.1にも更新してください。

+0

私はrealm verionを更新しましたが、どこでaptプラグインをbuild.gradleファイルで使用しましたか?私はすべてのソースを掲示した@Newbie – BekaKK

+0

私の悪い、aptの使用はありません。レルムバージョンの更新後も問題は解決していませんか? Morever、aptのbuild.gradleファイル(存在する場合)をチェックしてください。 –

+0

はいまだ@Newbie – BekaKK

関連する問題