Skip to content

WorkValidationException on add-to-app project for task ':flutter:copyFlutterAssetsRelease' on Gradle 8.1 and AGP 8.0 #129471

@strongville

Description

@strongville

Is there an existing issue for this?

Steps to reproduce

Start compiling app (task :app:assembleRelease)

  • Flutter Stable 3.10.5
  • AGP 8.0.1
  • Gradle 8.1
  • Add-to-app module (named ':flutter' on logs)
  • Java 17
  • Android Studio Giraffe 2022.3.1 RC 1

Expected results

Build succeeds and app is installed on device.

Actual results

Build fails on task :flutter:copyFlutterAssetsRelease, after finishing all other native tasks for the project.
Screenshot below shows the tasks with warnings or failures for the current build.

Code sample

This issue is not related with Dart code.

Screenshots or Video

Screenshots / Video demonstration

List of failed/with warning tasks
Latest tasks executed

Logs

Logs
FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':flutter:copyFlutterAssetsRelease' (type 'Copy').
  - Gradle detected a problem with the following location: '/home/strongville/[...]/flutter/.android/Flutter/build/intermediates/library_assets/release/out'.
    
    Reason: Task ':flutter:bundleReleaseLocalLintAar' uses this output of task ':flutter:copyFlutterAssetsRelease' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':flutter:copyFlutterAssetsRelease' as an input of ':flutter:bundleReleaseLocalLintAar'.
      2. Declare an explicit dependency on ':flutter:copyFlutterAssetsRelease' from ':flutter:bundleReleaseLocalLintAar' using Task#dependsOn.
      3. Declare an explicit dependency on ':flutter:copyFlutterAssetsRelease' from ':flutter:bundleReleaseLocalLintAar' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 27s
208 actionable tasks: 56 executed, 1 from cache, 151 up-to-date

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.5, on KDE neon 5.27 5.19.0-45-generic, locale es_MX.UTF-8)
    • Flutter version 3.10.5 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (10 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /home/strongville/Android/Sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from
      https://releases.llvm.org/
    ✗ CMake is required for Linux development.
      It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from
      https://cmake.org/download/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from
      https://github.com/ninja-build/ninja/releases
    • pkg-config version 0.29.2
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)

[✓] Android Studio (version 2022.3)
    • Android Studio at
      /home/strongville/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10271316
    • Flutter plugin version 74.0.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] Android Studio (version 2022.3)
    • Android Studio at
      /home/strongville/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10320515
    • Flutter plugin version 74.0.3
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[!] Android Studio (version 2023.1)
    • Android Studio at
      /home/strongville/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-1/231.9011.34.2311.10335024
    • Flutter plugin version 74.0.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.79.2)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • SM A207M (mobile) • R9TMB02DK0J • android-arm64 • Android 11 (API 30)
    • Linux (desktop)   • linux       • linux-x64     • KDE neon 5.27 5.19.0-45-generic

[✓] Network resources
    • All expected network resources are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: existing-appsIntegration with existing apps via the add-to-app flowplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions