I updated Android studio to 3.5 but there is a problem when I use android annotations
Gradle may disable incremental compilation as the following annotation processors are not incremental: jetified-androidannotations-4.6.0.jar (org.androidannotations:androidannotations:4.6.0).
Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task and make compilation incremental
I've put android.enableSeparateAnnotationProcessing=true in the gradle.properties file
but it's say that
INFO: The option setting 'android.enableSeparateAnnotationProcessing=true' is experimental and unsupported. The current default is 'false'.
Could not find the AndroidManifest.xml file
If you've updated your Android Studio to 1.3. 2 version then I would suggest using Build Tools Version 23.0. 0 and compile API 23 Android 6.0. As for Gradle Version - 2.4 or higher up to latest 2.7.
The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here.
AndroidAnnotations does not support Gradle incremental annotation processing, yet. You can still build your app, it only means that incremental compilation time is not as fast as it could be. There is an issue for tracking the implementation of incremental processing.
Android Studio inserts the Android @Nullable and @NonNull annotations in detected locations in your code. After running a null analysis, it's good practice to verify the injected annotations.
Android supports a variety of annotations through the Annotations Support Library. You can access the library through the android.support.annotation package. Note: If a module has a dependency on an annotation processor, you must use the `annotationProcessor` dependency configuration to add that dependency.
This plugin allows to enhance the integration of annotation processors to Android Studio. Integrating the plugin involves adding the buildscript declaration with the android-apt dependency, applying the plugin and setting the arguments for the plugin.
I had almost the same problem and couldn't build my app after updating android studio and gradle to 3.5 but according to this answer I added this to my defaultConfig{} in app gradle and problem solved!
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()
]
}
}
There is 2 way of fixing this issue
Method One - Use Snapshot version
Current Annotation lib version is 4.6, to fix these error temporary you can use a Snapshot version
add the following URL in Project-level Gradle
buildscript {
repositories {
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
}
Method Two - Use javaCompileOptions
Add following code in gradle DSL
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments = ["resourcePackageName": android.defaultConfig.applicationId]
arguments = ["androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()]
}
}
}
Hope it will work :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With