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

2264 views android

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.

answered question

Post your colors.xml

1 Answer


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"?>
    <color name="colorPrimary">#5e5b5b</color>
    <color name="colorPrimaryDark">#48464b</color>
    <color name="colorAccent">#D81B60</color>

posted this

Have an answer?


Please login first before posting an answer.