Status Update
Comments
ch...@google.com <ch...@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
ch...@google.com <ch...@google.com> #3
The initial report (
However,
sg...@google.com <sg...@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.3
commit 01f7123c79b5c40ffba0537f4cf6f7a89be727a7
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:23:15 2022
Ensure out-value of Enum.valueOf is analyzed by enum unboxer
Bug:
Change-Id: Iacb3a41b00cc2afb4b2d4e5f26e763a9bc5202b4
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxerImpl.java
M src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
ap...@google.com <ap...@google.com> #11
Branch: 3.3
commit 84d394798bbf3f011a06637bfc22ca477e863e19
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:20:31 2022
Reproduce inadequate enum unboxing analysis for Enum.valueOf
Bug:
Change-Id: I9b04c9081de39fca941c6ee0570b0cfbdc024b30
A src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
M src/test/java/com/android/tools/r8/enumunboxing/EnumUnboxingTestBase.java
ap...@google.com <ap...@google.com> #12
Branch: 3.2
commit 2fc1900f0274d6c8e5451d452c35b0e476b5892f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:37:34 2022
Version 3.2.78
Bug:
Bug:
Bug:
Bug:
Change-Id: Iedbc13d21a676603a117980e01a98e117bb4bb60
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #13
Branch: 3.2
commit f6467492562cafdfdc851bc16acf1c52d9f50576
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:23:29 2022
Ensure out-value of Enum.valueOf is analyzed by enum unboxer
Bug:
Change-Id: Iacb3a41b00cc2afb4b2d4e5f26e763a9bc5202b4
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxerImpl.java
M src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
ap...@google.com <ap...@google.com> #14
Branch: 3.2
commit 843a0e56fa6bd72a8b7e8932164fe82dcaaab85d
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:20:23 2022
Reproduce inadequate enum unboxing analysis for Enum.valueOf
Bug:
Change-Id: I9b04c9081de39fca941c6ee0570b0cfbdc024b30
A src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
M src/test/java/com/android/tools/r8/enumunboxing/EnumUnboxingTestBase.java
ap...@google.com <ap...@google.com> #15
Branch: 3.3
commit 01f7123c79b5c40ffba0537f4cf6f7a89be727a7
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:23:15 2022
Ensure out-value of Enum.valueOf is analyzed by enum unboxer
Bug:
Change-Id: Iacb3a41b00cc2afb4b2d4e5f26e763a9bc5202b4
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxerImpl.java
M src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
ap...@google.com <ap...@google.com> #16
Branch: 3.3
commit 84d394798bbf3f011a06637bfc22ca477e863e19
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Aug 10 18:20:31 2022
Reproduce inadequate enum unboxing analysis for Enum.valueOf
Bug:
Change-Id: I9b04c9081de39fca941c6ee0570b0cfbdc024b30
A src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
M src/test/java/com/android/tools/r8/enumunboxing/EnumUnboxingTestBase.java
ch...@google.com <ch...@google.com> #17
Thanks for reporting this. This should now be fixed in R8 versions 3.2.78 and 3.3.75. I will also cherry-pick this to R8 version 3.1.82.
ap...@google.com <ap...@google.com> #18
Branch: 3.1
commit 73f3a4859696c7ca4e1817064ab2dad4e394d0b8
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Aug 11 09:18:21 2022
Version 3.1.82
Bug:
Change-Id: Ifdda4179c8ecb85ede4e629987d0106e96670974
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #19
Branch: 3.1
commit acc43e89e26a4b947bdcadc6ee7b587e335b2ef0
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Aug 11 09:17:10 2022
Ensure out-value of Enum.valueOf is analyzed by enum unboxer
Bug:
Change-Id: Iacb3a41b00cc2afb4b2d4e5f26e763a9bc5202b4
M src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxer.java
ap...@google.com <ap...@google.com> #20
Branch: 3.1
commit d2dc31e5c429fe50f5709305f99c2429b582a3f3
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Thu Aug 11 09:13:36 2022
Reproduce inadequate enum unboxing analysis for Enum.valueOf
Bug:
Change-Id: I9b04c9081de39fca941c6ee0570b0cfbdc024b30
A src/test/java/com/android/tools/r8/enumunboxing/ValueOfWithoutCastEnumUnboxingTest.java
M src/test/java/com/android/tools/r8/enumunboxing/EnumUnboxingTestBase.java
Description
I started getting this error:
Tried to build using the following versions of R8:
Fails on all on them with
Unexpected conversion of imprecise type: TOP (everything)
I can provide more info if needed.