0

Once I create a new project I get an error

C:\Users\User\Desktop\4Find\app\src\main\res\values\colors.xml:9:18: Error: XML document structures must start and end within the same entity.

My colours.xml file at default looks as below;

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
    <component name="AndroidLayouts">
        <shared>
            <config />
        </shared>
    </component>
    <component name="AndroidLogFilters">
        <option n
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

4 Answers4

4

I faced this problem before. Instead of reinstall it, what i did was delete AndroidStudio file which located at C:\Users\YourUserName\.AndroidStudio3.2 (.AndroidStudio file name should depends on your android studio version). This will reset android studio to default setting.

Hope this could help you.

Tian
  • 62
  • 1
  • 4
0

colors.xml should be look like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#17AC82</color>
    <color name="colorPrimaryDark">#17AC82</color>
    <color name="colorAccent">#17AC82</color>
     ...........
</resources>
Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
  • Correct but Still gives an error Android resource compilation failed Output: C:\Users\User\Desktop\4Find\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xml:16: error: unclosed token. – Im new at this Nov 19 '18 at 11:41
  • 1
    The color related issue is fixed. Please check the `ic_launcher.xml` in **mipmap-anydpi-v26** token unclosed. Would you please share this `ic_launcher.xml` from **mipmap-anydpi-v26** directory? – Faysal Ahmed Nov 19 '18 at 11:56
  • @ErickIvuto is your problem solved ? – Faysal Ahmed Nov 19 '18 at 12:29
  • The solution was resetting android studio but your solution also worked. Many thanks – Im new at this Nov 28 '18 at 05:21
0

Something went wrong. It's not how colors.xml should look like, it's even not valid XML.

You can edit colors.xml but in my experience project will have other issues in its resources.
Try to create new project one more time.

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
0

Delete Android Studio file which located at

C:\Users\YourUserName\.AndroidStudio(version)
Mohamed Reda
  • 1,207
  • 13
  • 21