10

I checked the Local history of my XML files and double checked my Manifest file and found nothing wrong.

Before posting the question I went through a lot of similar posts and suggested answers but found nothing relevant to my issue. Down below you will find my LOG and hopefully one of you can guide me through a solution!

Android resource linking failed Output: \AndroidProjects\myApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. \AndroidProjects\myApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. \AndroidProjects\myApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:605: error: resource android:attr/fontVariationSettings not found. \AndroidProjects\myApp\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:605: error: resource android:attr/ttcIndex not found. error: failed linking references.

Command: C:\Users\lucif.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c9d8fd27aeabc6968bb2cb43f288855c\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\ C:\Users\lucif\AppData\Local\Android\Sdk\platforms\android-27\android.jar\ --manifest\ \AndroidProjects\myApp\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ \AndroidProjects\myApp\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ \AndroidProjects\myApp\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ \AndroidProjects\myApp\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ hivemind.lab.com.myApp\ -0\ apk\ --output-text-symbols\ \AndroidProjects\myApp\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

André Sousa
  • 1,541
  • 1
  • 11
  • 22
Thorvald Olavsen
  • 2,565
  • 3
  • 30
  • 50

5 Answers5

12

Solution 1: Set your compileSdkVersionto 28 and let Android Studio download the needed files.

enter image description here

If you already targetting this version, you could try cleaning your project and sync your gradle files.

André Sousa
  • 1,541
  • 1
  • 11
  • 22
  • it almost worked know it generates this error `Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:6:5-25:19 to override. ` – Thorvald Olavsen Nov 02 '18 at 18:59
  • 3
    This is because you are using the new Material library with the legacy Support Library. You have to migrate `android.support` to `androidx`. Please take a look at this guide: https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md – André Sousa Nov 02 '18 at 19:02
  • Thank you saved a lot of time. – Ravikiran D Feb 04 '19 at 14:43
  • @AndréSousa after migrating to androidx , interestingly kotlin fragment layouts not importing views. error : Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: – Jithish P N Mar 14 '19 at 06:19
  • @AndréSousa How do I migrate android.support to androidx ? I am trying to update Google Places SDK and got this error after changing my Compile SDK Version to 28 – LizG Aug 13 '19 at 21:15
7

In my case, I made two custom backgrounds which were not recognised.

I removed the <?xml version="1.0" encoding="utf-8"?> tag from the top of those two XML resources file.

This worked for me, after trying many solutions from the community. Errors with XML files are quite hard to figure out. They even trickle their impact down to Java files.

Ananth
  • 1,895
  • 16
  • 34
  • In my case in particular, was an unknown char inside a string tag in my strings, after delete it, the app build successfully. – Talu Sep 27 '19 at 01:21
1

I solved this problem with a little change in the build.Gradle (Module:app) file. just add or remove or change version of a library then sync your project..this worked for me.

Ali.Yazdani
  • 123
  • 2
  • 6
0

I had a similar problem..

Turns out I was using a dependency that was too updated and not compatible with my Min sdk in my app build.gradle file

Using a lower version solved the problem

Lilvinco
  • 15
  • 4
0

The problem here is related to the reference not being found. Try checking the values files for any problem first. Secondly, you can look into your Xml files to check for any wrong attribute for any view. The last way for solving is to clean and rebuild your project or invalidate and restart.