You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Cannot pass resourcePackageName to new annotationProcessor #1964
apt plugin is not compatible with Gradle build tools 2.3.0 so I've switched to annotationProcessor and used approach suggested here.
I have two different applicationId based on flavor. I cannot build flavor dev. AA is looking in wrong package (should use "com.my.app" but instead "com.my.app.debug" is used). Flavor prod, which has default applciationId works. This setup works with apt and 2.2.3 tools.
I think resourcePackageName is not passed properly to AA.
Log:
14:23:45.477 [Daemon worker Thread 23] ERROR o.a.i.r.ProjectRClassFinder:47 - The generated com.my.app.debug.R class cannot be found`
apt plugin is not compatible with Gradle build tools 2.3.0 so I've switched to annotationProcessor and used approach suggested here.
why do you think that it is not compatible? I just updated build tools to 2.3.0 and gradlew to 3.3 and with android-apt 1.8 i can build my app. even when i add product flavours.
can you supply a sample project where you have this issue so that i can see if i can reproduce it? :)
I've created a sample project showing that android-apt is now incompatible with google plugins like databinding.
If you try to compile it fails.
When you remove the line apply plugin: 'android-apt' it compiles fine.
As you can see, I did not even add androidannotations. android-apt is deprecated since 2.3 canary came out and since current and future google plugins will rely on the new annotation processor, androidannotations should use it as well. AATest.zip
@couchcrew-thomas thank you for that information. I didn't know that.
I'll see what I can do to get the stuff working. I just wonder why my app is building fine with 2.3 and android-apt. Maybe because I'm not using stuff like databinding.
As we have implemented some code that automatically finds the AndroidManifest.xml it is no longer necessary to provide the path in build.gradle (see #1543). That means that the old snipped to add parameters is no longer necessary... we only need the resourcePackageName for flavors with different applicationId than the one in defaultConfig
@dodgex Thank you for help. I can confirm that it's working now. I remember that arg androidManifestFile was mentioned somewhere in doc and it was part I always paste to every new project.
And thank you for trick with applicationIdSuffix, really useful👍
Ola amigos eu tive esse mesmo problema. O problema estava no atributo applicationId dentro do build.gradle do projeto android, eu estava usando o id de outro projeto ao inves de usar o id do projeto que eu havia baixado, nisso nem precisei usar esse Jack bugado que criaram.
Activity
qhutch commentedon Mar 7, 2017
Hi @AleksanderMielczarek, I have the same problem, did you manage to find a solution to compile your app in debug ?
dodgex commentedon Mar 7, 2017
Hey guys, I'm going to test this with my app if i can reproduce - and hopefully fix this issue.
dodgex commentedon Mar 7, 2017
@AleksanderMielczarek
why do you think that it is not compatible? I just updated build tools to 2.3.0 and gradlew to 3.3 and with android-apt 1.8 i can build my app. even when i add product flavours.
can you supply a sample project where you have this issue so that i can see if i can reproduce it? :)
AleksanderMielczarek commentedon Mar 7, 2017
@dodgex I get message about incompatibility in quite big project which I'm unable to paste here but I'll prepare example project and let you know.
couchcrew-thomas commentedon Mar 8, 2017
@dodgex : android-apt is now officially deprecated: https://bitbucket.org/hvisser/android-apt/wiki/Migration
So androidannotations should be made compatible with the new annotationProcessor.
couchcrew-thomas commentedon Mar 8, 2017
I've created a sample project showing that
android-aptis now incompatible with google plugins like databinding.If you try to compile it fails.
When you remove the line
apply plugin: 'android-apt'it compiles fine.As you can see, I did not even add androidannotations.
android-aptis deprecated since 2.3 canary came out and since current and future google plugins will rely on the new annotation processor, androidannotations should use it as well.AATest.zip
AleksanderMielczarek commentedon Mar 8, 2017
@couchcrew-thomas I'am using databinding so that would be the reason why build fails for me.
dodgex commentedon Mar 8, 2017
@couchcrew-thomas thank you for that information. I didn't know that.
I'll see what I can do to get the stuff working. I just wonder why my app is building fine with 2.3 and android-apt. Maybe because I'm not using stuff like databinding.
AleksanderMielczarek commentedon Mar 8, 2017
@dodgex Here is sample project with mentioned issue:
https://github.com/AleksanderMielczarek/AndroidAnnotationsAnnotationProcessorIssue
dodgex commentedon Mar 9, 2017
@AleksanderMielczarek Thank you for that project. I think I found a solution. 🎉
As we have implemented some code that automatically finds the
AndroidManifest.xmlit is no longer necessary to provide the path in build.gradle (see #1543). That means that the old snipped to add parameters is no longer necessary... we only need theresourcePackageNamefor flavors with differentapplicationIdthan the one indefaultConfigthe above snipped can me removed instead one can provide the arguments directly from the defaultConfigblock:
with this change the build is working. :)
dodgex commentedon Mar 9, 2017
btw and a little bit offtopic:
you do not need to provide full
applicationIdfor your flavors. The below block has the same effekt than yours. :)AleksanderMielczarek commentedon Mar 9, 2017
@dodgex Thank you for help. I can confirm that it's working now. I remember that arg
androidManifestFilewas mentioned somewhere in doc and it was part I always paste to every new project.And thank you for trick with applicationIdSuffix, really useful👍
dodgex commentedon Mar 9, 2017
Nice! I'll close the issue then :)
Before 4.0.0
androidManifestFilewas a required argument and it looks no one updated the wiki :Ddodgex commentedon Mar 11, 2017
The wiki has been updated: https://github.com/androidannotations/androidannotations/wiki/Building-Project-Gradle
couchcrew-thomas commentedon Mar 13, 2017
It still fails for library projects. I've created a new issue since it does not match the OT of this one. #1974
gustavotaveira commentedon Jan 9, 2018
Ola amigos eu tive esse mesmo problema. O problema estava no atributo applicationId dentro do build.gradle do projeto android, eu estava usando o id de outro projeto ao inves de usar o id do projeto que eu havia baixado, nisso nem precisei usar esse Jack bugado que criaram.