Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Update to New Android Studio 3.2 I got error

Android resource compilation failed
Output:  C:\Users\Desktop\Pulse-AR\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2381: error: <item> inner element must either be a resource reference or empty.
C:\Users\Desktop\Pulse-AR\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2398: error: <item> inner element must either be a resource reference or empty.

Command: C:\Users\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\bc8857d6afe6e4598f406355cc075303\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
        -o \
        C:\Users\Desktop\Pulse-AR\app\build\intermediates\res\merged\debug \
        C:\Users\values\values.xml
Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

values.xml:2398

 <item name="tag" type="id">tag</item>

Above error gives in after update new AndroidStudio(3.2) with Update Gradle (gradle-4.6-all)

like image 209
Viral Patel Avatar asked Sep 26 '18 12:09

Viral Patel


3 Answers

Try add below option inside gradle.properties

android.enableAapt2=false
like image 89
shizhen Avatar answered Nov 12 '22 08:11

shizhen


go to ids.xml file

replace <item name="tag" type="id">tag</item> with <item name="tag" type="id"/>

if this tag <item name="tag" type="id">tag</item> is not exist, then mean that tag is inside the library you are using, so just add the tag <item name="tag" type="id"/> for override it from the library.

after you override that tag, you can find which library is using that tag by find usage , and fix that library.

like image 45
jefry jacky Avatar answered Nov 12 '22 07:11

jefry jacky


Have been working through this problem all day, lots of head scratching.

What worked for me was going into the ids.xml, and removing all values between the item tags of "type=id"

For example:

<item type="id" name="icon">textToBeRemoved</item>

Goes to

<item type="id" name="icon"></item>

I hope this helps!

like image 39
JamTheMan Avatar answered Nov 12 '22 08:11

JamTheMan