我尝试按照
中的步骤操作http://greenrobot.org/eventbus/documentation/subscriber-index/
但由于某种原因,MyeventBusIndex根本就没有生成!
有什么理由说明为什么会这样吗?
android {
compileSdkVersion 27
defaultConfig {
applicationId "my.application.id"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
arguments = [ eventBusIndex : 'com.example.myapp.MyEventBusIndex' ]
}
}
}
}
dependencies {
compile 'org.greenrobot:eventbus:3.1.1'
annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.1.1'
}
我有gradle 3.0.1
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
答案 0 :(得分:1)
在build.gradle中添加该配置后,单击 Build-> Make ,然后将生成 MyEventBusIndex 。