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.
AS 3.2 Alpha - Could not find the AndroidManifest.xml file, using generation folder #2128
On Android Studio 3.2 Alpha 8 with according build gradle plugin and using build variants its not posible to build the app. When downgrade to stable Android Studio 3.1 and build gradle plugin 3.1.0 the build works fine.
\app\build\generated\source\apt\flavtest\androidannotations.log
10:13:34.489 [Daemon worker Thread 11] ERROR o.a.i.h.AndroidManifestFinder:147 - Could not find the AndroidManifest.xml file, using generation folder [C:\Users\username\Documents\_Projects\Appname\app\build\generated\source\apt\flavtest\debug])
+1 issue, noticed same thing.
Did try, no luck arg("androidManifestFile", variant.outputs[0].processResourcesTask.manifestFile) arg("resourcePackageName", android.defaultConfig.applicationId)
This works on Windows with Android Studio - allows me to build the project and release a signed apk. Let me know if you figure out any better solution. On other OS the path might need to be adjusted.
Reacted by Petr V, Jason, Máté Homolya, Louis CAD, SimplySu, Dmitriy Godlevskiy, Federico Torres, Victor Ude, Giovanni Terlingen and Git-World
PR is up and @WonderCsabo will review it asap I think. As soon as he has reviewed and merged the PR you can use the 4.5.0-SNAPSHOT wihtout the androidManifestFile option
Reacted by Petr V, Federico Carrizo, evilsloth and Vit Veres
I tried using 4.5.0-SNAPSHOT, the bug still persisted until I used the manifest argument. My manifest location is app\build\intermediates\merged_manifests\debug\AndroidManifest.xml
I just tried the 4.5.0-SNAPSHOT and it is not working for me.
I have debug and release buildTypes and qa,stage and prod flavors where I add a applicationIdSuffix.
I removed the kapt arguments block and ran the command: ./gradle clean assembleStageRelease
I get an error that says: e: error: The generated $MY_PACKAGE_STAGE_.R class cannot be found
I did not test much, but it seems to be the same to other variants too.
To avoid using a SNAPSHOT version in a production code (don't know when exactly anything will be done from the AA team), I ended up with this solution (based on tips from other developers). It works for Kotlin projects that use KAPT and consider flavors (this is my scenario).
Create a file with this script (to avoid putting a lot of [temporary] code in your build.gradle):
It's not perfect because gradlew build will not work.
But for the rest it's working.
You also need to modify the line Pattern pattern = Pattern.compile(":(assemble|generate)(\\w+)")
to Pattern pattern = Pattern.compile("(assemble|generate|lint|test)(\\w+)")
This works on Windows with Android Studio - allows me to build the project and release a signed apk. Let me know if you figure out any better solution. On other OS the path might need to be adjusted.
Activity
sandsaber commentedon Mar 28, 2018
+1 issue, noticed same thing.
Did try, no luck
arg("androidManifestFile", variant.outputs[0].processResourcesTask.manifestFile) arg("resourcePackageName", android.defaultConfig.applicationId)petacz commentedon Mar 29, 2018
+1
I am not using build variants.
It is broken even with com.android.tools.build:gradle:3.2.0-alpha07
com.android.tools.build:gradle:3.2.0-alpha06 works fine
PetrKrestaAi commentedon Mar 29, 2018
+1
Same event without variants
zqr95518 commentedon Apr 3, 2018
+1
Broken with 3.2.0-alpha09 also.
petacz commentedon Apr 18, 2018
Also with 3.2.0-alpha10 and 11
zqr95518 commentedon Apr 27, 2018
It seems if you not import or use the EActivity, they will generate correctly.
carrymaster commentedon Jun 5, 2018
Also with 3.2.0-alpha16. Any solution without removing EActivity annotation?
veresvit commentedon Jun 5, 2018
Managed to make it work before the issue is fixed by adding this to the module's build.gradle android.defaultConfig:
This works on Windows with Android Studio - allows me to build the project and release a signed apk. Let me know if you figure out any better solution. On other OS the path might need to be adjusted.
rajeshsubramanian commentedon Jun 5, 2018
Appreciate it @veresvit. This worked for me on macOS HS too.
carrymaster commentedon Jun 5, 2018
Thanks @veresvit! This worked perfectly.
But with this solution, would we be using the debug manifest in release?
dodgex commentedon Jun 9, 2018
I'm currently working on a fix for this one.
dodgex commentedon Jun 9, 2018
PR is up and @WonderCsabo will review it asap I think. As soon as he has reviewed and merged the PR you can use the
4.5.0-SNAPSHOTwihtout theandroidManifestFileoptionpetacz commentedon Jun 13, 2018
Link to PR #2147
LouisCAD commentedon Jun 18, 2018
Here's my solution for a Kotlin project (using kapt), that works my multi-buildTypes project:
I define this method at the top of my build.gradle file:
Then, in each buildType closure, I add this:
kapt { arguments { arg('androidManifestFile', manifestPath(name)) } }Namnodorel commentedon Sep 19, 2018
I tried using
4.5.0-SNAPSHOT, the bug still persisted until I used the manifest argument. My manifest location isapp\build\intermediates\merged_manifests\debug\AndroidManifest.xml(AS 3.2 RC3)
juliocbcotta commentedon Sep 19, 2018
I just tried the 4.5.0-SNAPSHOT and it is not working for me.
I have debug and release buildTypes and qa,stage and prod flavors where I add a
applicationIdSuffix.I removed the kapt arguments block and ran the command:
./gradle clean assembleStageReleaseI get an error that says:
e: error: The generated $MY_PACKAGE_STAGE_.R class cannot be foundI did not test much, but it seems to be the same to other variants too.
luanmm commentedon Oct 9, 2018
To avoid using a SNAPSHOT version in a production code (don't know when exactly anything will be done from the AA team), I ended up with this solution (based on tips from other developers). It works for Kotlin projects that use KAPT and consider flavors (this is my scenario).
Create a file with this script (to avoid putting a lot of [temporary] code in your
build.gradle):Then, in your
build.gradlefile, import this script:Credits to:
Kenji94 commentedon Oct 10, 2018
It's not perfect because
gradlew buildwill not work.But for the rest it's working.
You also need to modify the line
Pattern pattern = Pattern.compile(":(assemble|generate)(\\w+)")to
Pattern pattern = Pattern.compile("(assemble|generate|lint|test)(\\w+)")dodgex commentedon Oct 13, 2018
AndroidAnnotations 4.5.0 just has been released and should be available on maven central soon !
fededri commentedon Oct 25, 2018
You saved me
dodgex commentedon Oct 25, 2018
@fededri you can now just the latest 4.5.x version, this workaround is no longer needed. and for AS 3.3-beta/3.4-alpha you can use the 4.6.0-SNAPSHOT