Getting Error: Content is not allowed in prolog in Android Studio

When i try to build my 1st app "Hello World" in Android Studio, i face this error message. I attach the screenshot also. Anyone having idea how to solve this. enter image description here

C:\Users\WINDOWS\AndroidStudioProjects\app\src\main\res\values\colors.xml:1:1: Error: Content is not allowed in prolog.

1 answer

  • answered 2018-11-08 07:59 VikaS

    There are certainly some weird characters (e.g. BOM) or some whitespace before the XML preamble(<?xml ...?>) check your colors.xml and type below code and add your color codes. I was also facing same issue I followed same steps...

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <color name="colorPrimary">#5e5b5b</color>
        <color name="colorPrimaryDark">#48464b</color>
        <color name="colorAccent">#D81B60</color>
    </resources>