Android 上未生成 Eventbus 索引

Zhe*_*Liu 1 android greenrobot-eventbus

我尝试按照以下步骤操作

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'

}
Run Code Online (Sandbox Code Playgroud)

我有 gradle 3.0.1

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
    }
}
Run Code Online (Sandbox Code Playgroud)

zwh*_*zwh 5

在build.gradle中添加该配置后,单击Build->Make,然后将生成MyEventBusIndex 。