Status Update
Comments
lo...@gmail.com <lo...@gmail.com> #2
Does it also make AndroidManifest.xml
optional when not needed for library modules?
sp...@google.com <sp...@google.com> #3
Yes, thanks, that's not supported yet, but that's within the scope of this bug.
xs...@gmail.com <xs...@gmail.com> #4
In 7.0.0-alpha05
the AndroidManifest.xml
file is required but you can omit the package
declaration when namespace
is defined through DSL.
The minimal valid manifest content is <manifest />
.
sp...@google.com <sp...@google.com> #5
Re: #2 and #3, I reopened
ys...@google.com <ys...@google.com> #6
Before I open a separate bug, I followed the migration when updating to AGP 7.1.0, and it works generally but the Android Studio manifest editor shows the following in the merged tab.
Merging Errors: Error: Main AndroidManifest.xml at AndroidManifest.xml manifest:package attribute is not declared
This is with AS Chipmunk. Is this known issue, or expected in Chipmunk? Need a clean repro?
sp...@google.com <sp...@google.com> #7
Re #6, which version of AS Chipmunk are you using? Beta 1?
ps - AFAIK, #6 is not a known issue
ys...@google.com <ys...@google.com> #8
Thanks, I can raise a bug with an extracted repro if needed.
Android Studio Chipmunk | 2021.2.1 Canary 7
Build #AI-212.5457.46.2112.8043657, built on January 5, 2022
sp...@google.com <sp...@google.com> #9
I'm able to repro. I'll file a separate bug and work on a fix. Thanks Yuri!
ps - I filed
cj...@gmail.com <cj...@gmail.com> #10
Please let me know if this should be a new issue but AGP 7.3 Beta1 warns about using package
within the manifest xml even though we do not have a manifest file and are already using namespace
> Task :recyclerview-items:processReleaseManifest
package="com.careem.subscription.internal.recyclerview.items" found in source AndroidManifest.xml: /Users/Efe/Projects/Careem/subscription-sdk/android/recyclerview-items/build/intermediates/tmp/ProcessLibraryManifest/release/tempAndroidManifest2424595280278774479.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
Notice the manifest file above is from the build
directory.
sp...@google.com <sp...@google.com> #11
Re #10, thanks, yes, that's a known issue that was fixed in time for AGP 7.3 beta 3; see
ys...@google.com <ys...@google.com> #12
There seem to be some tangentially related issues like
This may be a code bug requiring a fix in the project, but it isn't surfaced to the user. I'm pretty sure I've found a number of ways to trigger manifest merging failures, is there some way to surface these types of errors more obviously, or does this improve in AGP 7.4.x?
sp...@google.com <sp...@google.com> #13
Re #12, thanks, I replied on
I'm pretty sure I've found a number of ways to trigger manifest merging failures, is there some way to surface these types of errors more obviously, or does this improve in AGP 7.4.x?
Can you elaborate on the specify ways?
ys...@google.com <ys...@google.com> #14
Not, I was sort of treating them as all related. Another one is
an...@gmail.com <an...@gmail.com> #15
sp...@google.com <sp...@google.com> #16
Re: #15, can you add more details so I can reproduce? What version of Android Gradle plugin are you using?
an...@gmail.com <an...@gmail.com> #17
I have an xml file with a textview, I set a text as a value and then hit "extract string". If the package name is not set in AndroidManifest it throws an error ( see screenshot ).
My android studio info:
Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Runtime version: 11.0.12+7-b1504.28-7817840 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: com.intellij.marketplace (212.5712.51), mobi.hsz.idea.gitignore (4.3.0), String Manipulation (9.5.0), org.intellij.plugins.markdown (212.5457.16), com.thoughtworks.gauge (212.4746.52), org.jetbrains.kotlin (212-1.7.0-release-281-AS5457.46)
sp...@google.com <sp...@google.com> #18
Re #17, that looks like
sp...@google.com <sp...@google.com> #19
As of Android Gradle plugin version 8.0.0-alpha03, namespace
is required to be set via the DSL.
sp...@google.com <sp...@google.com>
ch...@gmail.com <ch...@gmail.com> #20
sp...@google.com <sp...@google.com> #21
Re: #20, can you give more details (error message, repro instructions, etc.)? You can file a separate bug and link it on this thread.
ul...@gmail.com <ul...@gmail.com> #22
So, I'm not able to migrate from Gradle 7.x to 8.x on Flutter project.
sp...@google.com <sp...@google.com> #23
So, I'm not able to migrate from Gradle 7.x to 8.x on Flutter project.
If you add the matching namespace
DSL to each sub-module's build.gradle file (it must match the value of the package
attribute in the manifest), then there shouldn't be a problem.
Description
(Forked from another bug )
The here .
package
attribute in the sourceAndroidManifest.xml
is used to namespace theR
class, resolve any relative class names declared in theAndroidManifest.xml
, and namespace theBuildConfig
class; seeInstead of getting this value from the manifest, AGP should add
namespace
toBaseExtension
andtestNamespace
toTestedExtesion
, which devs could use like so:Eventually
namespace
should be required to be specified via the DSL, with no option to specify it via thepackage
attribute in theAndroidManifest.xml
. Here's a rough possible timeline:AndroidManifest.xml
to DSL via upgrade wizardpackage
attribute is found in the source manifest.Don't allowRequirepackage
attribute in sourceAndroidManifest.xml
namespace
to be set via the DSL