Status Update
Comments
ha...@google.com <ha...@google.com>
je...@google.com <je...@google.com>
am...@google.com <am...@google.com> #2
Can you confirm that you started seeing this issue only from AGP 8.1 onwards? Wondering if you know the last AGP version where this can be reproduced.
am...@google.com <am...@google.com> #3
I am unable to reproduce this bug. If I create a new project with a single module and add the queries
block you provided in the description, the processDebugManifest does not fail. From the error message, it appears that we are merging the file with itself. Can you confirm that this fails for you on a new project with a single module and this queries
block in manifest file? Please share the sample project on which we can reproduce this if possible.
ga...@linecorp.com <ga...@linecorp.com> #4
I uploaded failed case on
And I found this error is related with flavor specific
$ git clone https://github.com/ganadist/VersionCodeDemo -b ManifestMergerFail
$ cd VersionCodeDemo
$ ./gradlew :app:bundleDevelopDebug
> Task :app:processDevelopDebugMainManifest FAILED
VersionCodeDemo/app/src/develop/AndroidManifest.xml:24:19-77 Error:
Attribute provider@authorities value=(com.sonymobile.home.resourceprovider) from AndroidManifest.xml:24:19-77
is also present at AndroidManifest.xml:25:19-58 value=(com.android.badge).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml to override.
VersionCodeDemo/app/src/develop/AndroidManifest.xml:24:19-77 Error:
Attribute provider@authorities value=(com.sonymobile.home.resourceprovider) from AndroidManifest.xml:24:19-77
is also present at AndroidManifest.xml:26:19-77 value=(com.huawei.android.launcher.settings).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml to override.
am...@google.com <am...@google.com> #5
Thanks. I can reproduce the issue now. The problem is in manifest merger process. We incrementally build the merged manifest as we merge the elements of manifest file of the dependencies. Here, we have 3 provider nodes and after adding the first one, when we try to merge the next provider node, we are incorrectly looking for the provider node in merged manifest. I am working on a fix right now. This is a regression.
am...@google.com <am...@google.com> #6
Fix for this is checked-in(in studio-main). It will be available in Giraffe Canary 9.
ga...@linecorp.com <ga...@linecorp.com> #7
I tried to check with Giraffe Canary 9.
And I confirmed my issue was solved.
Thank you for your help.
Description
Since Android Gradle Plugin 8.1.0-alpha02, `:app:processDebugMainManifest` task was failed.
STEPS TO REPRODUCE:
1. AndroidManifest.xml has following elements to display badge count on several launchers.
```
<manifest>
<queries>
<provider android:authorities="com.sonymobile.home.resourceprovider" />
<provider android:authorities="com.android.badge" />
<provider android:authorities="com.huawei.android.launcher.settings" />
</queries>
</manifest>
```
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
```
$ ./gradlew :app:bundleDebug
> Task :app:processDebugMainManifest FAILED
app/src/main/AndroidManifest.xml:2187:19-77 Error:
Attribute provider@authorities value=(com.sonymobile.home.resourceprovider) from AndroidManifest.xml:2187:19-77
is also present at AndroidManifest.xml:2188:19-58 value=(com.android.badge).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml to override.
app/src/main/AndroidManifest.xml:2187:19-77 Error:
Attribute provider@authorities value=(com.sonymobile.home.resourceprovider) from AndroidManifest.xml:2187:19-77
is also present at AndroidManifest.xml:2189:19-77 value=(com.huawei.android.launcher.settings).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml to override.
See
```
Workaround : Just add `tools:replace="android:authorities"` on provider element
```
<manifest>
<queries>
<provider android:authorities="com.sonymobile.home.resourceprovider" />
<provider android:authorities="com.android.badge"
tools:replace="android:authorities" />
<provider android:authorities="com.huawei.android.launcher.settings"
tools:replace="android:authorities" />
</queries>
</manifest>
```
But it seems to be weird, because these should not be replaced by `processDebugMainManifest` task.
------------------
IMPORTANT: Please read
all required information.
------------------
Studio Build: N/A
Version of Gradle Plugin: Android Gradle Plugin 8.1.0-alpha02 - alpha06 (latest alpha release)
Version of Gradle: 8.0
Version of Java: OpenJDK 17
OS: Any