Status Update
Comments
ap...@google.com <ap...@google.com> #2
We're seeing a similar error in our code. Appears to be a combination of AGP 8.6.0 and Kotlin 2 needed to hit it.
private fun Intent.stripUnwantedFlags() {
// Explicitly remove the new task and clear task flags (Our browser activity is a single
// task activity and we never want to start a second task here).
flags = flags and Intent.FLAG_ACTIVITY_NEW_TASK.inv()
flags = flags and Intent.FLAG_ACTIVITY_CLEAR_TASK.inv()
// IntentReceiverActivity is started with the "excludeFromRecents" flag (set in manifest). We
// do not want to propagate this flag from the intent receiver activity to the browser.
flags = flags and Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.inv()
}
All 3 lines then hit:
Must be one or more of: Intent.FLAG_GRANT_READ_URI_PERMISSION, Intent.FLAG_GRANT_WRITE_URI_PERMISSION, Intent.FLAG_FROM_BACKGROUND, Intent.FLAG_DEBUG_LOG_RESOLUTION, Intent.FLAG_EXCLUDE_STOPPED_PACKAGES, Intent.FLAG_INCLUDE_STOPPED_PACKAGES, Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, Intent.FLAG_GRANT_PREFIX_URI_PERMISSION, Intent.FLAG_ACTIVITY_MATCH_EXTERNAL, Intent.FLAG_ACTIVITY_NO_HISTORY, Intent.FLAG_ACTIVITY_SINGLE_TOP, Intent.FLAG_ACTIVITY_NEW_TASK, Intent.FLAG_ACTIVITY_MULTIPLE_TASK, Intent.FLAG_ACTIVITY_CLEAR_TOP, Intent.FLAG_ACTIVITY_FORWARD_RESULT, Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP, Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS, Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT, Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED, Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY, Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET, Intent.FLAG_ACTIVITY_NEW_DOCUMENT, Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET, Intent.FLAG_ACTIVITY_NO_USER_ACTION, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT, Intent.FLAG_ACTIVITY_NO_ANIMATION, Intent.FLAG_ACTIVITY_CLEAR_TASK, Intent.FLAG_ACTIVITY_TASK_ON_HOME, Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS, Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT, Intent.FLAG_ACTIVITY_REQUIRE_NON_BROWSER, Intent.FLAG_ACTIVITY_REQUIRE_DEFAULT, Intent.FLAG_RECEIVER_REGISTERED_ONLY, Intent.FLAG_RECEIVER_REPLACE_PENDING, Intent.FLAG_RECEIVER_FOREGROUND, Intent.FLAG_RECEIVER_NO_ABORT, Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS
ap...@google.com <ap...@google.com> #3
The initial report (
However,
ap...@google.com <ap...@google.com> #4
Thanks for fixing! What release should we be able to verify the fix in? And is there any chance of a backport for 8.6.1?
ap...@google.com <ap...@google.com> #7
Thanks for the update!
ap...@google.com <ap...@google.com> #8
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Canary 2
- Android Gradle Plugin 8.8.0-alpha02
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ap...@google.com <ap...@google.com> #9
The fixes for this issue are now also available in:
- Android Studio Ladybug | 2024.2.1 RC 1
- Android Gradle Plugin 8.7.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
ap...@google.com <ap...@google.com> #10
Branch: 3.2
commit 29b97fd567eab7a3a91b371703046bad385b47a8
Author: Ian Zerny <zerny@google.com>
Date: Wed Sep 07 11:13:11 2022
Move class conflict resolver into internal options.
Bug:
Change-Id: Ie3ff481895b8b09336f37defbc4782deb509c27f
M src/main/java/com/android/tools/r8/graph/LazyLoadedDexApplication.java
M src/main/java/com/android/tools/r8/DexFileMergerHelper.java
M src/main/java/com/android/tools/r8/graph/DexApplication.java
M src/main/java/com/android/tools/r8/utils/InternalOptions.java
M src/main/java/com/android/tools/r8/dex/ApplicationReader.java
ze...@google.com <ze...@google.com> #11
This API is now on 3.2 and 4.0 so tools can use it if the change to DexFileMerger flows to a path with and older D8.
See cl/472695637
ap...@google.com <ap...@google.com> #12
Branch: 3.2
commit ea532dbb7d1dd4d27e08613e8a55de97ae65138f
Author: Søren Gjesse <sgjesse@google.com>
Date: Thu Sep 08 15:58:52 2022
Version 3.2.80
Resolve merge issues in 3.2.79.
Bug:
Change-Id: I4e230bc56a85852719c2c6ad8e1865565f519c8c
M src/main/java/com/android/tools/r8/utils/ProgramClassCollection.java
M src/main/java/com/android/tools/r8/Version.java
M src/main/java/com/android/tools/r8/dex/ApplicationReader.java
ap...@google.com <ap...@google.com> #13
Branch: 3.3
commit 8217864d4a75503a69911143c52bf76d10cf16ce
Author: Ian Zerny <zerny@google.com>
Date: Fri Sep 09 11:42:52 2022
Version 3.3.78
Bug:
Change-Id: I0c260d0a0f76cbd23f67d75d5367ed2e849f2290
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #14
Branch: 3.3
commit b1d28df67039cc8bb7d5adf3cbbc47fd54e58bba
Author: Ian Zerny <zerny@google.com>
Date: Fri Sep 09 11:42:35 2022
Add API for resolving duplicate definition conflicts.
Bug:
Change-Id: I40294a8be3a8af70fa902d599c68a3df49004a29
M src/main/java/com/android/tools/r8/R8Command.java
M src/test/java/com/android/tools/r8/invalid/DuplicateDefinitionsTest.java
M src/main/java/com/android/tools/r8/D8Command.java
M src/main/java/com/android/tools/r8/utils/ProgramClassCollection.java
A src/test/java/com/android/tools/r8/compilerapi/classconflictresolver/ClassConflictResolverTest.java
M src/main/java/com/android/tools/r8/L8Command.java
M src/test/java/com/android/tools/r8/invalid/DuplicateProgramTypesTest.java
M src/test/java/com/android/tools/r8/compilerapi/CompilerApiTestCollection.java
M src/main/java/com/android/tools/r8/BaseCompilerCommand.java
A src/main/java/com/android/tools/r8/ClassConflictResolver.java
ap...@google.com <ap...@google.com> #15
Branch: 3.3
commit 89b3113da07834ac285de196fd069c3f75b14ea6
Author: Ian Zerny <zerny@google.com>
Date: Fri Sep 09 11:27:20 2022
Move class conflict resolver into internal options.
Bug:
Change-Id: Ie3ff481895b8b09336f37defbc4782deb509c27f
M src/main/java/com/android/tools/r8/graph/LazyLoadedDexApplication.java
M src/main/java/com/android/tools/r8/DexFileMergerHelper.java
M src/main/java/com/android/tools/r8/graph/DexApplication.java
M src/main/java/com/android/tools/r8/utils/InternalOptions.java
M src/main/java/com/android/tools/r8/dex/ApplicationReader.java
ze...@google.com <ze...@google.com>
go...@gmail.com <go...@gmail.com> #16
Travis acct zdvm saccharine
ap...@google.com <ap...@google.com> #17
Branch: main
commit 636dd075e983ee6a2a63c7ca3ecabaf65219dfb2
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 08 13:56:50 2023
Remove DexFileMergerHelper
Bug:
Change-Id: I4f9d0c78deda94dca39c7bf89eda1de1820a3e2a
D src/main/java/com/android/tools/r8/DexFileMergerHelper.java
M src/test/java/com/android/tools/r8/desugar/desugaredlibrary/MergingJ$Test.java
Description
This is derived from b/240438146 .
Right now bazel use DexFileMergerHelper from D8/R8 for merging, if the class can be found. If it is not found the standard D8 merging is used.
The
DexFileMergerHelper
implements support for multiple definitions when merging DEX using an internal conflict resolution API. So without extending the D8 API this cannot be moved to bazel code.The problem for bazel is that the b/240438146 ).
r8lib.jar
that is released on Maven does not have the classDexFileMergerHelper
(no keep rule in the build for it), so with the new bazel support for pulling D8/R8 from Maven the default D8 merging is used failing when there are duplicate classes (which is what was reported inWith the API landed the code can be moved to bazel.