- [SOLVED] Android resource linking failed Error: failed linking file resources.
- Cause
- Solution
- Tips to finding the problem XML quickly
- Android resource linking failed for magicretry_fragment.xml #3
- Comments
- mvij commented Aug 21, 2019
- here4learning commented Aug 22, 2019
- mvij commented Aug 22, 2019
- here4learning commented Aug 22, 2019
- Ranjithsp6 commented Aug 27, 2019
- here4learning commented Aug 27, 2019
- Ranjithsp6 commented Aug 27, 2019
- himgupta229 commented Sep 4, 2019 •
- jakal23 commented Feb 1, 2020
[SOLVED] Android resource linking failed Error: failed linking file resources.
- Posted by Finco Agbontaen
- 2 Comments
- Categories: Android Errors & Solutions, Tutorials
This error sometimes also comes as “Android resource linking failed” is another frequent and vague error in Android Studio. The solution sometimes could be quite boring and painful but I assure you, this error is absolutely nothing serious.
Cause
The error shows up when Gradle encounters an error (Usually a syntax or typo error) in one or more of your XML files.
Most of the XML files are located in the res folder, however, you might still find some outside the res folder. For example, the AndroidManifest.xml located in “/src/main/AndroidManifest.xml”. Here is an example of a layout file that would give the “Error: failed linking file resources” error.
Note the “android:endCollor” attribute.
Solution
The solution to the error is obvious, right? All you have to do is go through each of your XML files to figure out where the error might be. This could sometimes be time-consuming but be rest assured that the error will disappear as soon as you find and fix the problem child (problem XML).
You might be lucky and Android Studio will point you in the exact direction as shown in the screenshot below:
Other times like when you are using an older version of Android Studio, the error would not be this specific.
Tips to finding the problem XML quickly
If you have a lot of XML files and it would be just too difficult to go through them one after the other, you could use the following tips to make the process easier:
- Undo: Most times, you are already halfway through a project before you experience this issue. Meaning that it was a recent change to one of your XML files that caused the issue. If that is the case, you can try to undo your recent change to the XML files. To undo, simply use the key combination: Ctrl+Z.
- Open every XML file: The second method involves simply opening every single XML file in your project (Without scanning). The reason for this is that sometimes, after opening the problem XML file, Android Studio then detects the error and underlines it.
If you enjoyed this post, feel free to share it. If you have any questions, feel free to ask them in the comment box below. 🙂
Источник
Android resource linking failed for magicretry_fragment.xml #3
Comments
mvij commented Aug 21, 2019
When i try to build this lib using Android Studio 3.5.0, i get the following error
AGPBI: <"kind":"error","text":"Android resource linking failed","sources":[<"file":"/home/vijith/.gradle/caches/transforms-2/files-2.1/0c1b042f08a50764c3d60743091442f0/jetified-magicretry-1.0.7/res/layout-v11/magicretry_fragment.xml","position":<"startLine":120>>],»original»:»/home/vijith/.gradle/caches/transforms-2/files-2.1/0c1b042f08a50764c3d60743091442f0/jetified-magicretry-1.0.7/res/layout-v11/magicretry_fragment.xml:121: AAPT: error: resource android:attr/android:progressBarStyleSmall not found.\n «,»tool»:»AAPT»>
The text was updated successfully, but these errors were encountered:
here4learning commented Aug 22, 2019
mvij commented Aug 22, 2019
The layout file magicretry_fragment.xml in layout-v11 res folder has ?android:attr/android:progressBarStyleSmall at line 126. It should be ?android:attr/progressBarStyleSmall or ?attr:progressBarStyleSmall
here4learning commented Aug 22, 2019
yes.Correct. But it is not accessible to change the xml. . So it has to be done at Payu side.
Ranjithsp6 commented Aug 27, 2019
yes.Correct. But it is not accessible to change the xml. . So it has to be done at Payu side.
have you found the temporary solution?
here4learning commented Aug 27, 2019
Create a folder within main res folder and create the xml file according to last comment of the link »
https://stackoverflow.com/questions/57588753/aapt-error-resource-androidattr-androidprogressbarstylesmall-not-found» . it will override payumoney xml file.
Ranjithsp6 commented Aug 27, 2019
Create a folder within main res folder and create the xml file according to last comment of the link »
https://stackoverflow.com/questions/57588753/aapt-error-resource-androidattr-androidprogressbarstylesmall-not-found» . it will override payumoney xml file.
Thank you its working
himgupta229 commented Sep 4, 2019 •
What is the gradle plugin version you are using?
jakal23 commented Feb 1, 2020
Have the same problem migrating androidx
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник