刚刚升级到Android Studio 3.0,之前可以编译的项目出现了以下错误:
Error:java.lang.RuntimeException: 注释处理器现在必须明确定义。在编译类路径中发现以下依赖项包含注释处理器,请将它们添加到annotationProcessor配置中。
然而,这个“following”未被定义。这是我的build.gradle中编译声明的样子。
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true;
}
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.jakewharton.timber:timber:4.4.0'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.jpardogo.googleprogressbar:library:1.2.0'
compile 'com.wang.avi:library:2.1.3'
compile 'link.fls:swipestack:0.3.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.codemybrainsout.rating:ratingdialog:1.0.7'
compile 'org.greenrobot:greendao:3.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
provided 'org.projectlombok:lombok:1.12.6'
compile
和provided
已经被弃用,使用implementation
和compileOnly
。https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations - Beshoy FayezAnnotationProcessors
被用来在代码编译之前处理注释,例如@NonNull
。 - Abhishek Bansal