Status Update
Comments
sg...@google.com <sg...@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
Er...@gtempaccount.com <Er...@gtempaccount.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
Project: r8
Branch: 8.7
Author: Søren Gjesse <
Link:
Keep the instantiated class when identifying reflective construction
Expand for full commit details
Keep the instantiated class when identifying reflective construction
R=christofferqa@google.com
Fixes: b/387258081
Change-Id: Icad6778099e247c3f045b94f182ab217949a1d28
Files:
- M
src/main/java/com/android/tools/r8/shaking/Enqueuer.java
- M
src/test/java/com/android/tools/r8/shaking/reflection/ReflectiveNewInstanceTest.java
Hash: 7f7db9041a6c14f27c1aacc808374c968e39faf8
Date: Mon Jan 13 09:58:18 2025
ap...@google.com <ap...@google.com> #11
Project: r8
Branch: 8.7
Author: Søren Gjesse <
Link:
Version 8.7.28
Expand for full commit details
Version 8.7.28
R=christofferqa@google.com
Bug: b/387258081
Change-Id: I72cc81fbfb033dad6a78d61c3d9b392c7c326a7f
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: fdf74442918c2100d22c5bbb3c185044a58144cf
Date: Mon Jan 13 09:58:25 2025
sg...@google.com <sg...@google.com> #12
Thank you for the reply. It is true that compat mode does not remove the default constructor when classes are not removed, and looking at the output from the compiler the CountdownHelper
was still present with its default constructor. However the reflective identification in R8 (wrongly) did not keep the class, causing the class to be treated as never instantiated (that is always null
).
We have fixed the reflective identification, and this has been merged to R8 8.7.28. You can use this together with AGP 8.7.3 and then you don't need the additional keep rules. See
Thank you for the report and the simple reproduction.
an...@google.com <an...@google.com> #13
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 Patch 1
- Android Gradle Plugin 8.8.1
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!
Description
I updated AGP to 8.7.3 (uses R8 8.7.18) and observed one screen began to crash with
NullPointerException
when it called Coroutinejob?.cancel
method.I downgraded back to AGP 8.6.1 (uses R8 8.6.27) which no longer crashes.
I have made a sample project that replicates the code and crash.
Steps to reproduce
alpha
. This creates an obfuscated build.Launch countdown Activity
debug
. This is not obfuscated . Try the above steps and observe it works.If you downgrade the versions and build
alpha
it does not crash.Note my real project and sample project both have
android.enableR8.fullMode=false
ingradle.properties
.