Deleting the .gradle folder solved the problem for me. After syncing and downloading the dependencies again gradle was able to compile the app without any problems. yeahh ;)
task ':app:processDebugResources' produces invalid XML
-
16-07-2023 - |
Question
When I try to compile my project I get the error message
Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Program Files (x86)\Android\android-studio\sdk\build-tools\19.0.3\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-studio\sdk\platforms\android-19\android.jar -M C:\Users...\build\manifests\debug\AndroidManifest.xml -S C:\Users...\build\res\all\debug -A C:\Users...\build\assets\debug -m -J C:\Users...\app\build\source\r\debug -F C:\Users...\build\libs\app-debug.ap_ --debug-mode --custom-package com.my.packet --ignore-assets !.svn:!.git:!.ds_store:!.hg --output-text-symbols C:\Users...\build\symbols\debug
Error Code: 1 Output:
C:\Users...\build\res\all\debug\values\values.xml:584: error: Error parsing XML: not well-formed (invalid token)
I looked in the file at the location and found that the escape sequence …
of the original source xml would become the two bytes 85 3C
. Note that I really mean bytes: this isn't escaped in any form.
The header of the original xml was
<?xml version="1.0" encoding="utf-8"?>
The header of the generated xml also has utf-8 set as encoding.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
I am completely clueless what could cause this behavior, even more since everything is under version control and none of the files have been touched recently. Also I worked on the project just yesterday. The only thing that came to my mind was a Windows 8.1 updated that was installed in between. But I checked the update history and there isn't anything xml-related. Even if it were, it shouldn't interfere with the andorid build process as this would use Java, but it really was the only thing I could think of.
I tried to rebuild everything, I deleted the build folder and I deleted everything and checked it out again, nothing changed anything.
Solution
OTHER TIPS
Change android sdk location as (C:\Android\sdk) if your username contains non-english characters you'll get this error.