Status Update
Comments
bi...@mail.de <bi...@mail.de> #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
sg...@google.com <sg...@google.com>
mk...@google.com <mk...@google.com> #3
The initial report (
However,
mk...@google.com <mk...@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!
mk...@google.com <mk...@google.com>
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.
ze...@google.com <ze...@google.com> #10
This should be cherry picked to release branches too.
ap...@google.com <ap...@google.com> #11
Branch: 3.2
commit c1f5a649e6b174dc5c977090c70d2cb0cc4caf58
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 09:32:15 2022
Version 3.2.77
Bug:
Change-Id: I03b64963a474c2ad8709fffe6349769c8788df41
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #12
Branch: 3.2
commit 0d5e3c0c6516de5047c1747fda8ea5c5ac212bdf
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 09:30:51 2022
Split block after implicit store via DebugLocalWrite.
Bug:
Change-Id: I6023e442a97838dfa816ad778b49a96d99b608ac
M src/main/java/com/android/tools/r8/ir/code/DebugLocalWrite.java
M src/main/java/com/android/tools/r8/cf/LoadStoreHelper.java
M src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
ap...@google.com <ap...@google.com> #13
Branch: 3.2
commit 1cdabd9d14c033400d9bcfeb40b720523500283a
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 09:06:42 2022
Small regression test for invalid exceptional transfers.
Bug:
Change-Id: I8ac44f7df25f0a0ca28ed8a02c4a2a2946043bd9
M src/main/java/com/android/tools/r8/cf/CfRegisterAllocator.java
M src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
M src/main/java/com/android/tools/r8/utils/InternalOptions.java
ap...@google.com <ap...@google.com> #14
Branch: 3.2
commit 028f9e7d5b2a94b8bc8e3ba1f2c0f3eecc795564
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 08:55:57 2022
Add test for invalid stackmap for debug locals and trycatch
Bug:
Change-Id: I0edc7aa8bd827db46cae428e48964c47a99165f0
A src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
ap...@google.com <ap...@google.com> #15
Branch: 3.3
commit b46c3d970800b208b33ee6506d167444c434c7fb
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 12:32:58 2022
Version 3.3.72
Bug:
Change-Id: Ie4d364afbb9fa5fbc3d9e0a691747d3988351aec
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #16
Branch: 3.3
commit 1cbd003b35f979a6c95ed13ccf03922ac32bf883
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 12:19:24 2022
Split block after implicit store via DebugLocalWrite.
Bug:
Change-Id: I6023e442a97838dfa816ad778b49a96d99b608ac
M src/main/java/com/android/tools/r8/ir/code/DebugLocalWrite.java
M src/main/java/com/android/tools/r8/cf/LoadStoreHelper.java
M src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
ap...@google.com <ap...@google.com> #17
Branch: 3.3
commit d86c058a65371a93762a10ee81b028e987c11263
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 12:19:13 2022
Small regression test for invalid exceptional transfers.
Bug:
Change-Id: I8ac44f7df25f0a0ca28ed8a02c4a2a2946043bd9
M src/main/java/com/android/tools/r8/cf/CfRegisterAllocator.java
M src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
M src/main/java/com/android/tools/r8/utils/InternalOptions.java
ap...@google.com <ap...@google.com> #18
Branch: 3.3
commit ee6fe4992c5267d5dfc3e9b178dcacb4de66bfc8
Author: Ian Zerny <zerny@google.com>
Date: Tue Aug 09 12:19:01 2022
Add test for invalid stackmap for debug locals and trycatch
Bug:
Change-Id: I0edc7aa8bd827db46cae428e48964c47a99165f0
A src/test/java/com/android/tools/r8/cf/CfDebugLocalStackMapVerificationTest.java
ze...@google.com <ze...@google.com> #19
Thanks for reporting this issue. The fix for it has landed on our main branch and release branches for 3.2 and 3.3.
You can locally use a newer version of R8 by updating your settings.gradle (or settings.gradle.kts) file with the below template:
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:<r8version>") // This should be 3.2.77 for AGP 7.2 or 3.3.72 for AGP 7.3
}
}
}
ap...@google.com <ap...@google.com> #20
Branch: 3.3
commit 77bf094c51e2ca9398e3ba36030efa8c2f923e1a
Author: Morten Krogh-Jespersen <mkroghj@google.com>
Date: Wed Aug 10 15:06:47 2022
Version 3.3.74
Bug:
Change-Id: I1251991627fa1028c60698aa2f5cfa5b75076c9a
M src/main/java/com/android/tools/r8/Version.java
bi...@mail.de <bi...@mail.de> #21
Thank you for fixing!
bi...@mail.de <bi...@mail.de> #22
What about
Description
When I shrink my shadow jar with r8, r8 messes up. I created a sample project where r8 is told not to do anything, still the jar contains invalid bytecode, leading to the VerifyError:https://github.com/binarynoise/ktor-test
As far as I can tell, my toolchain is up-to-date. Also happens with the CIO implemenatation of Ktor. As the not-minified shadow jar works as intended, I suspect r8 to be buggy.
This is my build log: