Development issue/problem:

Error detail

U003citemu003e internal element must either be a source reference or empty… source: [file:…].xml,position:{startLine:2,startColumn:4,startOffset:57,endColumn:61,endOffset:114}}],original:,tool:AAPT}
Error: java.util.concurrent.ExecutionException: : AAPT2 error : Check the logs for more details
:app:mergeDebugResources FAILED

SAFETY : The design failed with one exception.

The ‘:app:mergeDebugResources’ task has failed.
> Error: java.util.competitor.ExecutionException: : AAPT2 error : Check the data for the parts.

Source file


Building environment

How can I solve this problem?

Solution 1:

If you give a resource ID, the body must be empty.

For more information, see the link below.

So, as Oliver Manyasa said, it should be like this.

Solution 2:

I had a similar problem after upgrading to Android Studio 3.2.1.

The error was about this element in the ids.xml file


As mentioned by user Sangeet Suresh, I changed it to

That solved the problem.

Solution 3:

For those who are still stretching their brains to find a solution to this problem, create an ids.xml in src/main/res/values with a content similar to the next one (but make sure you update it with the ids you see errors in) :

Now Android Studio generates an error for explicit values, and if those values come from a library you’re using, you can’t make any changes to the intermediate file, so edit here instead and when you merge your code, Android Studio will take care of it.

Solution 4:

In your resource file, delete both the closing tag and the body, i.e. delete tv_deviceName.

and make your source file look like this:

Solution No 5:

For me it actually failed because the new versions of Gradles. I’m pretty sure some of the plugins I use are not compatible with the latest diploma. I managed that with the next versions:

Get ready for graduation. Properties file :


build.gradle file

Dependencies {
classpath ‘’


Since we now want to use the 3.2.+ versions, this is not a reliable solution.

I finally created a new ids.xml file and overwrote all inconsistent values.

an example of the ids.xml file :

Solution No 6:

I put this automatically generated file in res/xml/values with empty tags such as

That’s just it!

Solution No 7:

I made the following mistake

Wrong: The internal element must either be a link to the source or empty.

In my case I created a new test project and removed the toolbar and fab from the activity_main.xml file, but they were also in the ids.xml file. After removing both identifiers from the ids.xml file, I could get started. Your IDs.xml file can have a lot of identifiers, but since I created a new project, it doesn’t have one anymore.

Give here a description of the image

The screenshot above shows the exact location of the file.

Solution No 8:

In the values folder I double-clicked the ids.xml file that caused problems


Give here a description of the image

I tried some of the answers you chose:

But I have a mistake that says:

The element type Element must be closed with the corresponding End tag.

To fix this, I just added a fitting end label:


I’m new to Cotlin, and what just struck me, and what I didn’t understand, is the need to end the slash before closing >. If you don’t turn it on, you will get the error message I received, but if you turn it on, the accepted answer works.

Good luck!

android resource compilation failed,android resource linking failed,ids xml,agpbi: (kind'':error'',text'':android resource compilation failed),item> inner element must either be a resource reference or empty in android,resource and asset merger error in android studio,android resource linking failed styles xml,android resource linking failed cardview

You May Also Like

How to Repair Error 0x80070666 when Installing Microsoft Visual C++

RECOMMENDED: Click here to fix Windows errors and optimize system performance. The…

Download, Install & play Virtual Police Officer Game Police Cop Simulator NAME on PC (Windows & Mac)

Virtual Police Officer is an excellent simulator that puts players in the…

6 Best Free Alternatives Of Quetext of 2021

The most common problem when submitting or uploading content is plagiarism. Many…

7 Best WordPress Portfolio Plugins in 2021

In this article I will share seven of the best WordPress portfolio…