改用gradle4.1遇到一些问题。
Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
寻找解决方法时遇到有
去掉app的build.gradle中的apply plugin: ‘android-apt’
把apt相关的地方换成annotationProcessor
如 : apt ‘com.jakewharton:butterknife-compiler:8.8.1’ –> annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
但我项目中没有任何moudle有 android-apt,报错指向但build.gradle文件是其中一个moudle的,如下
apply plugin: 'com.android.library'
apply plugin: 'realm-android'
android {
//...
}
repositories {
maven { url "https://jitpack.io" }
maven {
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}
dependencies {
//...
}
排查发现是realm-android中会导致这个报错,推测应该是realm-android中带有apt的部分吧。注释掉就好了。