Repository navigation
WorkValidationException on add-to-app project for task ':flutter:copyFlutterAssetsRelease' on Gradle 8.1 and AGP 8.0 #129471
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jun 26, 2023 Thanks for the report.
Can you take a look at below links and see if they help in your case ?- addedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 26, 2023 This seems to be a workaround that requires amending the files generated by the Flutter SDK (same files that shouldn't be added to version control), is this correct?
These lines were added to
.android/Flutter/build.gradle:afterEvaluate { bundleDebugLocalLintAar.dependsOn copyFlutterAssetsDebug bundleReleaseLocalLintAar.dependsOn copyFlutterAssetsRelease }This solves the exception previously shown above. Is there a way for this to be included by default when generating files on Flutter SDK? I see the referred comment was posted several months ago, is there a blocking issue or major refactor awaiting?
Personally, I'd like to depend on as less workarounds as possible, to be able that the team members can configure the project more easily.
Also, to be able to use AGP 8.0 we require Gradle 8, so, for this case, downgrading Gradle versions to the one where this is a warning instead of an exception, isn't a choice either, unfortunately.
Reacted by Bartek Pacia and SoftickSupport- removedwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jun 29, 2023 Thanks for the update. Keeping this issue open based on the error received and above feedback.
- addedplatform-androidAndroid applications specificallyAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.t: gradle"flutter build" and "flutter run" on Android"flutter build" and "flutter run" on Androida: existing-appsIntegration with existing apps via the add-to-app flowIntegration with existing apps via the add-to-app flowand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Jun 30, 2023 - addedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work list
on Jul 6, 2023 To whoever takes this bug: this is probably a problem we have with other tasks. When fixing this bug, identify anything in the code that can allow us to audit the rest of our code for similar problems.
- addedteam-androidOwned by Android platform teamOwned by Android platform team
on Jul 8, 2023 4 remaining items
@sunchangtan thank you so much! it helped.
This seems to be a workaround that requires amending the files generated by the Flutter SDK (same files that > These lines were added to
.android/Flutter/build.gradle:afterEvaluate { bundleDebugLocalLintAar.dependsOn copyFlutterAssetsDebug bundleReleaseLocalLintAar.dependsOn copyFlutterAssetsRelease }Where exactly does this go? I tried adding this to my build.gradle as a workaround but I get this error
`A problem occurred configuring root project 'Timing'.
A problem occurred configuring project ':flutter'.
Could not get unknown property 'copyFlutterAssetsDebug' for extension 'flutter' of type FlutterExtension.
`@jnstahl Use the workaround from sunchangtan. It helps.
@sunchangtan @jnstahl
I added the double quotes to the original workaround:afterEvaluate { bundleDebugLocalLintAar.dependsOn "copyFlutterAssetsDebug" bundleReleaseLocalLintAar.dependsOn "copyFlutterAssetsRelease" }Now, I don't need to change Flutter sources.
Unfortunately, the double quotes only helped me with my Jenkins (Linux) build.
I still need to change Flutter sources on my Windows work PC.I hope this will be helpful.
project build.gradle add this:
subprojects { sub -> sub.afterEvaluate { proj -> if (proj.name == 'flutter') { def flutterProject = project(':flutter') flutterProject.afterEvaluate { bundleDebugLocalLintAar.dependsOn "copyFlutterAssetsDebug" bundleReleaseLocalLintAar.dependsOn "copyFlutterAssetsRelease" } } } }Reacted by leon- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listP1High-priority issues at the top of the work listHigh-priority issues at the top of the work listand removedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work listP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Oct 26, 2023 #137370 should land shortly, and fixed this issue in my local reproduction. There are multiple workflows to run add to app projects though, so please let me know if it doesn't fix it for you
Reacted by Guillermo Villafuerte- added a commit that references this issue
on Oct 26, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Oct 27, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Nov 13, 2023
Is there an existing issue for this?
Steps to reproduce
Start compiling app (task :app:assembleRelease)
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
Logs
Logs
Flutter Doctor output
Doctor output