美文网首页
ButterKnife8.5.1和Eventbus3.0.0冲突

ButterKnife8.5.1和Eventbus3.0.0冲突

作者: jtsky | 来源:发表于2017-03-16 16:21 被阅读461次

    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冲突

          本文链接:https://www.haomeiwen.com/subject/dxejnttx.html