Configuring Your Android Build
To get started you must add the Micronaut annotation processors to the processor classpath using the annotationProcessor
dependency configuration.
The Micronaut micronaut-inject-java
dependency should be included in both the annotationProcessor
and compileOnly
scopes of your Android build configuration:
Example Android build.gradle
dependencies {
...
annotationProcessor "io.micronaut:micronaut-inject-java:2.2.3"
compileOnly "io.micronaut:micronaut-inject-java:2.2.3"
...
}
If you use lint
as part of your build you may also need to disable the invalid packages check since Android includes a hard coded check that regards the javax.inject
package as invalid unless you are using Dagger:
Configure lint within build.gradle
android {
...
lintOptions {
lintOptions { warning 'InvalidPackage' }
}
}
You can find more information on configuring annotations processors in the Android documentation.
Micronaut inject-java dependency uses Android Java 8 support features. |