Using a debug "applicationIdSuffix" causes compilation errors #1888
Comments
You should add the following to your app-level apt {
arguments {
resourcePackageName "com.fubar.appidsuffixtest" // or android.defaultConfig.applicationId
}
} |
Thank you! I also just found the comment on the Gradle config wiki page that said to do the same thing. Apologies for the obvious RTFM issue. |
Hello guys First of all, thanks for your amazing work on AndroidAnnotation :) I try to build my app with AndroidAnnotation 4.3.1 and last gradle version:
everything worked fine until I want to use debug {
applicationIdSuffix ".debug"
} -> Impossible to generate AndroidAnnotation classes, I got errors such as: I tried with the following javaCompileOptions {
annotationProcessorOptions {
arguments = ["resourcePackageName": android.defaultConfig.applicationId]
}
} Is AndroidAnnotation compatible with this new gradle version? |
I just tested this setup with my current work in progress app and it works. I assume you have som errors while processing. You should check the full error log carefully. |
It works with new gradle tool version :) thanks! |
I bumped into it using kapt. I have a project which is using the debug prefix and also works with Android Annotations. So I am looking at the AA demo by @WonderCsabo, and he answers in this thread as well. So the same issue, and solution.
|
Adding this to my project:
causes builds to fail:
I've been able to reproduce this with a simple project:
Android Studio 2.2.2
AA 4.1.0
android-apt 1.8
Starting with a new project, built from the "Empty Activity" project (min SDK 22, compile/target SDK 25), I then configure the Gradle build files as per instructions and add the debug app ID suffix. After this step the project continues to build successfully.
I then add modify activity_main.xml to add an id to the TextView:
and update MainActivity.java with corresponding annotations:
At this point building the project produces the error about the missing R class. The log file shows the same info as the error:
If I remove the debug app ID suffix, the project builds successfully once again. It seems that the application id is being used to resolve the R class:
Results in:
The text was updated successfully, but these errors were encountered: