Skip to content

Flutter config broken for Gradle 8.1.0 #63

@derekpitts28

Description

@derekpitts28

See solution here for fix: https://issuetracker.google.com/issues/277166577

From the issue:

Status: Won't Fix (Intended Behavior)
Thanks for sharing the repro. The issue is in the build script that triggers eager task creation, which breaks AGP task configuration. Please use:

tasks.configureEach {
     if(name.startsWith("connectedNet")) {
        enabled = false
    }
}
instead of tasks.whenTaskAdded (see [Gradle docs](https://docs.gradle.org/current/userguide/task_configuration_avoidance.html#sec:old_vs_new_configuration_api_overview) for more info). After this modification, R8 will fail with missing classes, so please follow instructions at https://developer.android.com/build/releases/past-releases/agp-7-0-0-release-notes#r8-missing-class-warning to fix that.

Sidenote: I'd advise against disabling tasks in this way. If you'd like to disable instrumented tests, see https://github.com/android/gradle-recipes/blob/0db8094e5a1a9661f61958db85380320157f5050/Groovy/disableAndroidTest/app/build.gradle#L15.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions