11

It happened out of nowhere. One day I was running my code which was working just fine, and the next day, without touching my build.gradle files or any other build files this error popped up.

I have tried a lot of different solutions like changing my buildToolsVersion or setting a specific flag of AAPT(can't remember which) to false. Nothing works. My app\build.gradle file:

 android { compileSdkVersion 27 buildToolsVersion '27.0.3' sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.skydevs.bookx" minSdkVersion 16 targetSdkVersion 27 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso- core:3.0.2' implementation 'com.google.firebase:firebase-core:16.0.1' } apply plugin: 'com.google.gms.google-services' 

The error I'm getting is:

Execution failed for task ':app:processDebugResources'. > Android resource linking failed Output: C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/fontVariationSettings not found. C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: C:\Users\baada\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a5cc63922d025d4315a498efa486650c\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\ C:\Users\baada\AppData\Local\Android\sdk\platforms\android-27\android.jar\ --manifest\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.example.bookx\ -0\ apk\ --output-text-symbols\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0 Output: C:\Users\baada\.gradle\caches\transforms-1\files-1.1\appcompat-1.0.2.aar\aa44270b14856bd5a0b17a3c0a45cb34\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found. C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found. C:\Users\baada\.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\bc8b94f938baa5558925fd51b49cb6bf\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found. C:\Users\baada\.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\bc8b94f938baa5558925fd51b49cb6bf\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: C:\Users\baada\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\a5cc63922d025d4315a498efa486650c\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\ C:\Users\baada\AppData\Local\Android\sdk\platforms\android-27\android.jar\ --manifest\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.example.bookx\ -0\ apk\ --output-text-symbols\ C:\Users\baada\AndroidStudioProjects\bookx\build\app\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0 
2
  • 1
    I'm getting a similar issue. Did you also recently upgraded some flutter packages? Commented Jan 26, 2019 at 9:26
  • i just fixed the similar issue ==> stackoverflow.com/a/71146453/13698241 Commented Feb 16, 2022 at 17:26

9 Answers 9

13

Today, I got the same error at my project which I was working on yesterday without any problem.

Some upgrade causes this error IMO, my solution is:

  • Open the project via Android Studio

  • Open android/build.gradle and android/app/build.gradle

  • Just correct things what IDE warns about, it usually warns your SDK, Kotlin and Gradle versions etc.

It's not mandatory but you can check your .bashrc exports or environment variables, sometimes it can fix some problems.

Edit: When you are updating your SDK versions, don't forget to upgrade also your project dependencies.

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

1 Comment

Thank you for your kind answare. There was many post like this but none with such accurated answare.
1

I had the same error while using flutter, but in my case the problem was caused by an incorrect line in a file in the 'res' folder in my Adroid projects.

You need to check your code, in my case it was calling a resource that doesn't exist in my android / app / src / main / res / launcher / drawable / launch_background.xml file, make sure all your resources and xml files are ok.

Comments

1

I think it depends on android emulator API level you are using.

In my case I used android emulator API 30, but compileSdkVersion was 28, so i got the error! By updating compileSdkVersion to 30, everything worked correctly!

OS: Ubuntu 20.04 LTS
Android emulator API 30
Dart 2.10.2
Flutter 1.22.2

Comments

0

Kindly check your strings.xml and It should be like:

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">App Name here</string> <string name="facebook_app_id">2206883509627625</string> <string name="fb_login_protocol_scheme">fb2206883509627625</string> </resources>

Special attention to add this line:

 <string name="app_name">App Name here</string>

Comments

0

check that How to fix "Execution failed for task ':app:processDebugResources'. > Android resource linking failed"[Android/Flutter]

I had the same error while using flutter, but in my case the problem was caused by an incorrect line in a file in the 'res' folder in my Adroid projects.

You need to check your code, in my case it was calling a resource that doesn't exist in my android / app / src / main / res / launcher / drawable / launch_background.xml file, make sure all your resources and xml files are ok.

Comments

0

To resolve this issue, run your flutter project in Android Studio rather than Visual Studio Code.

Comments

0
  • What went wrong: Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction Android resource linking failed C:\Users\DELL Precision\StudioProjects\Tictactoe\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:17: error: resource mipmap/ic_launcher (aka com.example.tictactoe:mipmap/ic_launcher) not found. error: failed processing manifest.

In my case I Just changed my all appicon name to ic_launcher while generating from appicon.co

and it doesn't show any error now that ic_launcher file is missing.

Comments

0

use this in your app/build.gradle compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion

2 Comments

THis answer provides no improved information over the other 8 answers.
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
-3

Make sure you are connected to the Internet and rebuild the project. That solves the problem for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.