Issue
Edit: solved, I went to Android Studio, File -> Invalidate Caches/Restart -> Invalidate and Restart, also did flutter clean for the projects. Now both run as expected. Finally.
I created a sample flutter app doing flutter create and then ran with flutter run. This is odd because a week ago I did the same thing and had no problems. And another weird thing, I created an hour ago another sample app and doing flutter run on that works perfectly fine. Same sample app, same code, but one has errors.
I am using Android API 31, no change since last week. I found 5 posts on this site, some were saying to change gradle build version or something but I wasn't sure what it meant exactly. Both sample apps were created in the same night, no edits. I have restarted my computer but no luck.
Here is the output of flutter run:
Running Gradle task 'assembleDebug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
AAPT: error: failed writing to 'C:\Users\Bob\Documents\coding\recipe\build\app\intermediates\runtime_symbol_list\debug\R.txt': The data is invalid. (13).
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s
Exception: Gradle task assembleDebug failed with exit code 1```
This is the result.
Solution
I went to Android Studio, File -> Invalidate Caches/Restart -> Invalidate and Restart, also did flutter clean for the projects. Now both run as expected. Finally.
Answered By - Bob the Builder
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.