ButterKnife8.5.1和Eventbus3.0.0冲突解决方案

root build.gradle

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'

第三方版本

"eventbus"  : "org.greenrobot:eventbus:3.0.0",

"eventbus-annotation-processor": "org.greenrobot:eventbus-annotation-processor:3.0.1",

"butterknife"  : "com.jakewharton:butterknife:8.5.1",

"butterknife-compiler": "com.jakewharton:butterknife-compiler:8.5.1",


app build.gradle

apply plugin: 'android-apt'

apply plugin: 'com.jakewharton.butterknife'

apt  rootProject.ext.dependencies["eventbus-annotation-processor"]

apt rootProject.ext.dependencies["butterknife-compiler"]

或者(androidStudio2.2及以上)

app build.gradle

annotationProcessor rootProject.ext.dependencies["eventbus-annotation-processor"]

annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]

defaultConfig{

     javaCompileOptions {

        annotationProcessorOptions {

             arguments = [ eventBusIndex : 'com.twl.qichechaoren_business.MyEventBusIndex' ]

        }

   }

}

你可能感兴趣的:(ButterKnife8.5.1和Eventbus3.0.0冲突解决方案)