EventBus添加索引和ButterKnife依赖

来源:互联网 发布:全套红鸟棋牌源码 编辑:程序博客网 时间:2024/05/20 05:53

     添加依赖:

compile  'org.greenrobot:eventbus:3.1.1'

annotationProcessor  'org.greenrobot:eventbus-annotation-processor:3.1.1'

   第一步,修改 app 下面的 build 文件

在 android>>defaultConfig 节点下面增加

javaCompileOptions {
annotationProcessorOptions {
arguments = [  eventBusIndex  :  'com.bwie.butterknife.MyEventBusIndex'  ]
}
}

如图:


ButterKnife依赖:

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