2

Why is this error keep coming when i'm executing my project? It occur once i put the image_picker in my pubspec.

FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. Android resource linking failed Output: /Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:331: error: resource android:attr/fontVariationSettings not found. /Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:331: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: /Users/s/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/6d65e55edb223325e7c5119d99552582/aapt2-3.2.1-4818971-osx/aapt2 link -I\ /Users/s/Library/Android/sdk/platforms/android-27/android.jar\ --manifest\ /Users/s/Desktop/Flutter/a/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /Users/s/Desktop/Flutter/a/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /Users/s/Desktop/Flutter/a/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ com.example.a\ -0\ apk\ --output-text-symbols\ /Users/s/Desktop/Flutter/a/build/app/intermediates/symbols/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0 Output: /Users/s/.gradle/caches/transforms-1/files-1.1/design-27.1.1.aar/fa938137e4d19d1dd06a6895b6e14886/res/values/values.xml:96:5-202: AAPT: error: resource android:attr/fontVariationSettings not found.

/Users/s/.gradle/caches/transforms-1/files-1.1/design-27.1.1.aar/fa938137e4d19d1dd06a6895b6e14886/res/values/values.xml:96:5-202: AAPT: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: /Users/s/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/6d65e55edb223325e7c5119d99552582/aapt2-3.2.1-4818971-osx/aapt2 link -I\ /Users/s/Library/Android/sdk/platforms/android-27/android.jar\ --manifest\ /Users/s/Desktop/Flutter/a/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /Users/s/Desktop/Flutter/a/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/Users/s/Desktop/Flutter/a/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /Users/s/Desktop/Flutter/a/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ com.example.a\ -0\ apk\ --output-text-symbols\ /Users/s/Desktop/Flutter/a/build/app/intermediates/symbols/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0

4
  • To fix it try. stackoverflow.com/a/54460559/10269042 Commented Feb 1, 2019 at 4:16
  • What is your compileSdkVersion (under android/app/build.gradle)? Commented Feb 1, 2019 at 7:30
  • @PhucTran 27 and for min i put 21 Commented Feb 1, 2019 at 7:42
  • @ali Can you try my answer below? Commented Feb 1, 2019 at 7:48

3 Answers 3

2

Change your compileSdkVersion to 28 (under android/app/build.gradle)

compileSdkVersion 28

Then run the command

flutter clean

Then run the project again.

Sign up to request clarification or add additional context in comments.

Comments

0

@PhucTran answer's is correct. Just want to add that i had to Invalidate Cache from Android Studio and Restart it.

File-> Invalidate Cahe and Restart

Comments

0

Year 2024, this error still happening:

Running Gradle task 'assembleDebug'...                          

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':image_picker_android:parseDebugLocalResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ParseLibraryResourcesTask$ParseResourcesRunnable
   > Failed file name validation for file /Users/elmar/Documents/GitHub/redacted_app/build/image_picker_android/intermediates/packaged_res/debug/xml/flutter_image_picker_file_paths 3.xml

* 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 3m 24s
Running Gradle task 'assembleDebug'...                            205.0s
Exception: Gradle task assembleDebug failed with exit code 1

And the solution is very simple, just need to clean build folders:

flutter clean

And now it will run and work without error.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.