Created a new project, did not add anything, an assembly occurred and an error was thrown out:

D:\Project\Hamster\app\src\main\res\values\colors.xml:1:1: Error: Content is not allowed in prolog. 

The color file looks like this:

 include ':app' 

I tried to add something like this:

  <?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#008577</color> <color name="colorPrimaryDark">#00574B</color> <color name="colorAccent">#D81B60</color> </resources> 

Throws an error:

 Android resource compilation failed Output: D:\Project\Hamster\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:1: error: not well-formed (invalid token). Command: C:\Users\Danilshik\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\feb1b0106ecb01d03bc5d06dff1df1c9\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \ -o \ D:\Project\Hamster\app\build\intermediates\res\merged\debug \ D:\Project\Hamster\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0 

Tried rebuild, clean, make project - did not help

Tried to delete the cache C: \ Users \ .gradle \ caches - did not help

Tried to create a new project - did not help

Tried to create a project in another place - did not help

I tried to install Android Studio again - it did not help

  • colors.xml in the form of normal xml, apparently, works. About ic_launcher_round.xml - maybe it's in UTF-8, not "UTF-8 without BOM"? How does it even look like you - is there a valid xml? - Regent
  • Thanks for the tip - danilshik

1 answer 1

I decided this way: I deleted all the xml from res, since at the end of the file they were in the wrong encoding. After made a successful compilation. Deleted the project and created it again so that xml appeared again.