Reputation: 7932
I tried to follow the steps in
http://greenrobot.org/eventbus/documentation/subscriber-index/
but for some reason the MyeventBusIndex simply doesn't get generated!
Are there any reasons why that is the case for me??
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'
}
I have gradle 3.0.1
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
Upvotes: 1
Views: 1173
Reputation: 71
Today try to generate the MyEventBusIndex class, I failed。I found if no @Subscribe function in my project(I create new project to test EventBus index), the MyEventBusIndex class will not generate,but I try to add the @Subscribe function and rebuild the project, then check the directory 'app/build/generated/source/..’, i generate the MyEventBusIndex.
Upvotes: 1
Reputation: 192
After adding that configs in build.gradle, click Build->Make then MyEventBusIndex will be generated.
Upvotes: 5