Android resource compilation failed 3 - android

Below this, is my issue in my App when try to built it. I've tried lots of things but was unable to solve it.
Android resource compilation failed
Output: D:\ashish android\DreamTouchIndia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2582: error: duplicate value for resource 'attr/theme' with config ''.
D:\ashish android\DreamTouchIndia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2582: error: resource previously defined here.
Command:
C:\Users\hp\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\3b90f5710266fb9a4db1b900d48eb915\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
D:\ashish android\DreamTouchIndia\app\build\intermediates\res\merged\debug \
D:\ashish android\DreamTouchIndia\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #2

check your module gradle . you may define dependency twice

Related

Error: Content is not allowed in prolog - colors.xml

I get this error "Error: Content is not allowed in prolog" in colors.xml everytime when I create a new project in Android Studio.
My auto generated colors.xml :
/* AUTO-GENERATED FILE. DO NOT MODIFY.** This class was automatically
generated by the* gradle plugin from the resource data it found. It* should not
be modified by hand.*/package android.ar
When I resolve this error by manually writing the correct code in colors.xml, this error comes :
Android resource compilation failed
Output: C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:1: error: not well-formed (invalid token).
Command: C:\Users\Lenovo\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\3fe9903feff1f1df45dbb24febdc7fc3\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\build\intermediates\res\merged\debug \
C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
anydpi-v26\ic_launcher_round.xml :
/* AUTO-GENERATED FILE. DO NOT MODIFY.** This class was automatically generated by the* gradle plugin from the resource data it found. It* should not be modified by hand.*/package android.support.localbroadcastmanager;
public final class R {pr
After resloving this , this error comes :
Android resource compilation failed
Output: C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:1: error: not well-formed (invalid token).
Command: C:\Users\Lenovo\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\3fe9903feff1f1df45dbb24febdc7fc3\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\build\intermediates\res\merged\debug \
C:\Users\Lenovo\AndroidStudioProjects\WhatstheWhether\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
After resolving this error, same error comes in ic_launcher_foreground.xml and ic_launcher_background.xml . After resolving all these errors when I run my project , another error comes - Error running 'app': Default Activity not found . So after editing configurations , my app runs fine but I have to follow this whole procedure in every new project. Please help.

I am getting the following errors in Android Studio “Android resource compilation failed”

Android resource compilation failed
Output: C:\Users\Christain Sheridan\Downloads\Crisis-Response\Crisis-
Response\app\src\main\res\layout\crisis_menu.xml:95: error: not well-formed (invalid token).
Command: C:\Users\Christain Sheridan\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\daf4756f8943226640d70255bc14ccd5\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\Christain Sheridan\Downloads\Crisis-Response\Crisis-Response\app\build\intermediates\res\merged\debug \
C:\Users\Christain Sheridan\Downloads\Crisis-Response\Crisis-Response\app\src\main\res\layout\crisis_menu.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #1
Update: I fixed it myself, it seems that when I use a git pull from my master it puts HEAD>>>>>>> and more stuff that looks like a commit stuff that somehow got in there. But once I removed all of them it worked so never mind.
it reads crisis_menu.xml:95: error: not well-formed (invalid token)
so you probably should check crisis_menu.xml at line 95.
and maybe use fetch & rebase instead of pull.

Can't compile files that don't belong to my project

I Replaced one attribute of all of my .xml files by a mistake. so I undo all of them . now Android failed to compile the project because of internal files that does not belong to my project . look at this Error for example:
Android resource compilation failed
Output: C:\Users\andrew\.gradle\caches\transforms-1\files-1.1\support-
compat-28.0.0.aar\0f40d142e6b58b7fe15914d4ec5e3dc5\res\layout\notification_action.xml:24: error: duplicate attribute.
Command: C:\Users\andrew\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\cacb99a92dc25d61ade7acbb3a469d02\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\andrew\AndroidStudioProjects\clone\app\build\intermediates\res\merged\debug \
C:\Users\andrew\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\0f40d142e6b58b7fe15914d4ec5e3dc5\res\layout\notification_action.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #3
this happened for many .xml in internal files .
my IDE is Android Studio 3.2.1
This happened to me .Delete this file C:\Users\andrew.gradle\caches\transforms-1 form windows and build your project. this should solve your problem .

Android Hello World Project Error: "Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #2"

2018/09/27
I upgraded android studio to 3.2.0 and created the default project.
But the compiler shows the error:
Android resource compilation failed
Output: C:\Users\DELL-BODETY\AndroidStudioProjects\MyApplication3\app\src\main\res\drawable\ic_launcher_background.xml:1: error: not well-formed (invalid token).
Command: C:\Users\DELL-BODETY\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\1135036532c8b3c53c96f89a2a22aaca\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\DELL-BODETY\AndroidStudioProjects\MyApplication3\app\build\intermediates\res\merged\debug \
C:\Users\DELL-BODETY\AndroidStudioProjects\MyApplication3\app\src\main\res\drawable\ic_launcher_background.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #1
And I can't think of any way out.Just for help!!
app\src\main\res\drawable\ic_launcher_background.xml:1: error: not
well-formed (invalid token).
Go to drawable directory and find this file: ic_launcher_background.xml.
It seems like there is a compilation error, spelling mistake, not well typed or etc. You need to check which one is. It should show an error or something with red line error. Probably, used semicolon or something similar.

error : duplicate value for attr/style with config ' '

After upgrading Android Studio to the latest version, it keeps on giving me this error and I can't run my code at all!!
Here's the error
Android resource compilation failed
Output: C:\Users\Khairy\Desktop\Patient App\android-patient-app\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1072: error: duplicate value for resource 'attr/style' with config ''.
C:\Users\Khairy\Desktop\Patient App\android-patient-app\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1072: error: resource previously defined here.
Command: C:\Users\Khairy\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\dd46b604dd8462c5ee8864f277da747e\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \
-o \
C:\Users\Khairy\Desktop\Patient App\android-patient-app\app\build\intermediates\res\merged\debug \
C:\Users\Khairy\Desktop\Patient App\android-patient-app\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
error: duplicate value for resource 'attr/style' with config ''
Check values.xml or styles.xml to see if there is any duplicate entries-strings. (called attr/style maybe)
You can also try removing intermediates or build directory then doing clean-rebuild project and then it should work as expected.

Categories

Resources