Android - resource linking failed / failed linking references

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.


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.


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.