5

I am just getting started to use the new Android Jack compiler and use the Greenrobot Eventbus.
I got it working after some trial-and-error but it only seems to work, when I specify the eventBusIndex parameter in 2 places - see code below:

android {
    defaultConfig {
        javaCompileOptions {
            annotationProcessorOptions {
                // TODO: why must I specify eventBusIndex twice? --> also for each buildVariant
                arguments = [
                  'eventBusIndex': "com.tmtron.dscontrol.EventBusIndex"
                ]
            }
        }
    }
    // this is a workaround to specify the Manifest for AndroidAnnotations
    // see: https://code.google.com/p/android/issues/detail?id=210753
    applicationVariants.all { variant ->
        variant.variantData.variantConfiguration.javaCompileOptions.annotationProcessorOptions
                .arguments = [
                      'eventBusIndex': "com.tmtron.dscontrol.EventBusIndex"
                    , 'androidManifestFile': variant.outputs[0]?.processResources?.manifestFile?.absolutePath
        ]
    }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
TmTron
  • 17,012
  • 10
  • 94
  • 142
  • did you figure this out @TmTron – Dan Aug 02 '17 at 06:06
  • @Dan No. The relevant bug is still open and also not solved in the newer build DSL (non-Jack): https://code.google.com/p/android/issues/detail?id=210753 – TmTron Aug 02 '17 at 07:25

0 Answers0