Status Update
Comments
so...@google.com <so...@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
ro...@ta-dah-apps.com <ro...@ta-dah-apps.com> #3
The initial report (
However,
ch...@google.com <ch...@google.com>
je...@google.com <je...@google.com>
so...@google.com <so...@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?
ro...@ta-dah-apps.com <ro...@ta-dah-apps.com> #7 Restricted
so...@google.com <so...@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!
so...@google.com <so...@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.
ro...@ta-dah-apps.com <ro...@ta-dah-apps.com> #10 Restricted
so...@google.com <so...@google.com> #11
Thank you!
Is there any apply plugin: 'com.android.test'
Gradle projects? [EDITED: removed as it is a different problem]
I can also reproduce some NullPointerException
s in Gradle. I'll file issues for both problems.
ro...@ta-dah-apps.com <ro...@ta-dah-apps.com> #12
so...@google.com <so...@google.com> #13
Notes:
This is the exception I get in Chipmunk with AGP 7.2.0 trying to sync the attached project. Surprisingly in studio-main
the same configuration reports an error.
in...@gotinder.com <in...@gotinder.com> #14
hi, we are experiencing same issue. AGP 7.1.x works ok but with AGP 7.2.x Android Studio fails with the same message. Command-line builds works ok.
The simplified configuration is:
flavorDimensions "store", "distribution"
productFlavors {
play {
dimension "store"
}
china {
dimension "store"
}
google {
dimension "distribution"
}
huawei {
dimension "distribution"
}
}
and then we are ignoring the non-local build variants:
def notNeededLocalEnvironment = [
'chinaHuaweiDebug',
'chinaHuaweiRelease',
'chinaGoogleDebug',
'chinaGoogleRelease',
'playHuaweiDebug',
'playHuaweiRelease']
android {
variantFilter { variant ->
def notNeeded = variant.name in notNeededLocalEnvironment
variant.setIgnore(notNeeded)
}
}
The error when trying to sync with AS is:
Cannot find a variant matching build type 'debug' and product flavors '[play]' in :app
However, if we execute a command-line ./gradlew :app:tasks it works.
Same configuration with AGP/AS 7.1 works when we sync the project.
iv...@gotinder.com <iv...@gotinder.com> #15
Hello, we're running into an issue that seems related to this. I've created a simple GitHub repo that allows to reproduce this issue fairly easy. In short, updating from AGP 7.1.3
to 7.2.1
without any changes to our build variant configuration results in gradle sync error, but building the project from the terminal raises no issues.
The specific error we're getting is:
Cannot find a variant matching build type 'debug' and product flavors '[gms]' in :app
I've added details of this in the README of the repo:
mt...@gmail.com <mt...@gmail.com> #16
so...@google.com <so...@google.com> #17
Thank you for the project that reproduces the problem.
so...@google.com <so...@google.com> #18
What causes a problem is a configuration in which a product flavour is completely eliminated by filtering variants.
so...@google.com <so...@google.com>
el...@gmail.com <el...@gmail.com> #19
so...@google.com <so...@google.com> #20
This is an issue in Android Studio and it is triggered by filtering variants in build configuration. It affects Android Studio Chipmunk+ using AGP 7.2+.
Description
The app has 3 flavours listed as "flavorDimensions "model", "cost", "market".
We have another app that has only 2 flavours and this syncs and builds OK. With this in mind I have artificially removed one flavour from the failing app so it reads "flavorDimensions "model", "market", and it will now syncs OK.
Is there perhaps an issue with projects that have more than two flavour dimensions?
Build: AI-212.5712.43.2112.8609683, 202205181650,
AI-212.5712.43.2112.8609683, JRE 11.0.12+0-b1504.28-7817840x64 JetBrains s.r.o., OS Mac OS X(aarch64) v12.4, screens 1920.0x1200.0
AS: Chipmunk | 2021.2.1 Patch 1; Kotlin plugin: 212-1.6.21-release-334-AS5457.46; Android Gradle Plugin: 7.2.1; Gradle: 7.3.3; Gradle JDK: version 11.0.12; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read