Strange error in colors.xml file in Android Studio












1














I've been searching for a solution for this but nobody actually can confirm ... when creating new android studio project




"colors.xml:9:18: Error: XML document structures must start and end
within the same entity."




I open that colors.xml it contains some wierd stuff :



<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayouts">
<shared>
<config />
</shared>
</component>
<component name="AndroidLogFilters">
<option n


and YES that is the full file ... it's not my first project and i know that's not how the file should look , even if I replaced the content with the correct syntax , many error of the same type in other files as well ,
so my question is , why is this happening ?
I tried clearing caches of android and deleted the cache of gradle entirely ...nothing seems to work , what could be the problem ? how this file even gets created in the first place ? is it a gradle problem ?










share|improve this question
























  • If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
    – Aaron
    Nov 21 at 0:17












  • i said it's a new project , i didn't change anything ... @Aaron
    – Ammar M Mashfj
    Nov 21 at 0:21










  • The xml is malformed and incomplete, it's likely causing the issue
    – Wayne Phipps
    Nov 21 at 0:28










  • So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
    – Aaron
    Nov 21 at 0:31










  • I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
    – Ammar M Mashfj
    Nov 21 at 0:36
















1














I've been searching for a solution for this but nobody actually can confirm ... when creating new android studio project




"colors.xml:9:18: Error: XML document structures must start and end
within the same entity."




I open that colors.xml it contains some wierd stuff :



<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayouts">
<shared>
<config />
</shared>
</component>
<component name="AndroidLogFilters">
<option n


and YES that is the full file ... it's not my first project and i know that's not how the file should look , even if I replaced the content with the correct syntax , many error of the same type in other files as well ,
so my question is , why is this happening ?
I tried clearing caches of android and deleted the cache of gradle entirely ...nothing seems to work , what could be the problem ? how this file even gets created in the first place ? is it a gradle problem ?










share|improve this question
























  • If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
    – Aaron
    Nov 21 at 0:17












  • i said it's a new project , i didn't change anything ... @Aaron
    – Ammar M Mashfj
    Nov 21 at 0:21










  • The xml is malformed and incomplete, it's likely causing the issue
    – Wayne Phipps
    Nov 21 at 0:28










  • So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
    – Aaron
    Nov 21 at 0:31










  • I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
    – Ammar M Mashfj
    Nov 21 at 0:36














1












1








1


1





I've been searching for a solution for this but nobody actually can confirm ... when creating new android studio project




"colors.xml:9:18: Error: XML document structures must start and end
within the same entity."




I open that colors.xml it contains some wierd stuff :



<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayouts">
<shared>
<config />
</shared>
</component>
<component name="AndroidLogFilters">
<option n


and YES that is the full file ... it's not my first project and i know that's not how the file should look , even if I replaced the content with the correct syntax , many error of the same type in other files as well ,
so my question is , why is this happening ?
I tried clearing caches of android and deleted the cache of gradle entirely ...nothing seems to work , what could be the problem ? how this file even gets created in the first place ? is it a gradle problem ?










share|improve this question















I've been searching for a solution for this but nobody actually can confirm ... when creating new android studio project




"colors.xml:9:18: Error: XML document structures must start and end
within the same entity."




I open that colors.xml it contains some wierd stuff :



<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayouts">
<shared>
<config />
</shared>
</component>
<component name="AndroidLogFilters">
<option n


and YES that is the full file ... it's not my first project and i know that's not how the file should look , even if I replaced the content with the correct syntax , many error of the same type in other files as well ,
so my question is , why is this happening ?
I tried clearing caches of android and deleted the cache of gradle entirely ...nothing seems to work , what could be the problem ? how this file even gets created in the first place ? is it a gradle problem ?







android xml gradle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 5:08









Lekr0

18610




18610










asked Nov 21 at 0:10









Ammar M Mashfj

63




63












  • If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
    – Aaron
    Nov 21 at 0:17












  • i said it's a new project , i didn't change anything ... @Aaron
    – Ammar M Mashfj
    Nov 21 at 0:21










  • The xml is malformed and incomplete, it's likely causing the issue
    – Wayne Phipps
    Nov 21 at 0:28










  • So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
    – Aaron
    Nov 21 at 0:31










  • I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
    – Ammar M Mashfj
    Nov 21 at 0:36


















  • If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
    – Aaron
    Nov 21 at 0:17












  • i said it's a new project , i didn't change anything ... @Aaron
    – Ammar M Mashfj
    Nov 21 at 0:21










  • The xml is malformed and incomplete, it's likely causing the issue
    – Wayne Phipps
    Nov 21 at 0:28










  • So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
    – Aaron
    Nov 21 at 0:31










  • I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
    – Ammar M Mashfj
    Nov 21 at 0:36
















If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
– Aaron
Nov 21 at 0:17






If that's in your resource folder, then just delete it. I could be wrong but it looks like a copy & paste mistake.
– Aaron
Nov 21 at 0:17














i said it's a new project , i didn't change anything ... @Aaron
– Ammar M Mashfj
Nov 21 at 0:21




i said it's a new project , i didn't change anything ... @Aaron
– Ammar M Mashfj
Nov 21 at 0:21












The xml is malformed and incomplete, it's likely causing the issue
– Wayne Phipps
Nov 21 at 0:28




The xml is malformed and incomplete, it's likely causing the issue
– Wayne Phipps
Nov 21 at 0:28












So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
– Aaron
Nov 21 at 0:31




So? It certainly doesn't look right, the xml is incomplete and no colors defined in it. You could either try deleting it, or find the history and revert it.
– Aaron
Nov 21 at 0:31












I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
– Ammar M Mashfj
Nov 21 at 0:36




I know , but it was created that way , and that is the question , why it was created that way ... @WaynePhipps
– Ammar M Mashfj
Nov 21 at 0:36












2 Answers
2






active

oldest

votes


















0














I don't know how you got that color xml but that's definitely not a color xml file.



A color.xml file looks like below image



enter image description here



Copy below code to your color.xml file to solve your error.



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="your_color">#FFFFFF</color>
</resources>





share|improve this answer

















  • 2




    My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
    – Ammar M Mashfj
    Nov 21 at 5:11



















0














I'm literally facing the same issue, did you somehow managed to resolve it?



I though I've been getting this error after invalidating cache and restart Android Studio but it seems to be some kind of different bug from IDE itself.






share|improve this answer





















  • nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
    – Ammar M Mashfj
    Dec 14 at 14:39










  • droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
    – dvlpr
    Dec 15 at 22:08











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403502%2fstrange-error-in-colors-xml-file-in-android-studio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I don't know how you got that color xml but that's definitely not a color xml file.



A color.xml file looks like below image



enter image description here



Copy below code to your color.xml file to solve your error.



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="your_color">#FFFFFF</color>
</resources>





share|improve this answer

















  • 2




    My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
    – Ammar M Mashfj
    Nov 21 at 5:11
















0














I don't know how you got that color xml but that's definitely not a color xml file.



A color.xml file looks like below image



enter image description here



Copy below code to your color.xml file to solve your error.



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="your_color">#FFFFFF</color>
</resources>





share|improve this answer

















  • 2




    My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
    – Ammar M Mashfj
    Nov 21 at 5:11














0












0








0






I don't know how you got that color xml but that's definitely not a color xml file.



A color.xml file looks like below image



enter image description here



Copy below code to your color.xml file to solve your error.



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="your_color">#FFFFFF</color>
</resources>





share|improve this answer












I don't know how you got that color xml but that's definitely not a color xml file.



A color.xml file looks like below image



enter image description here



Copy below code to your color.xml file to solve your error.



<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="your_color">#FFFFFF</color>
</resources>






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 at 4:17









Lekr0

18610




18610








  • 2




    My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
    – Ammar M Mashfj
    Nov 21 at 5:11














  • 2




    My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
    – Ammar M Mashfj
    Nov 21 at 5:11








2




2




My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
– Ammar M Mashfj
Nov 21 at 5:11




My question is about how the file got created that way ...not for how to fix this file in particular ... As i said it's not the only file ...
– Ammar M Mashfj
Nov 21 at 5:11













0














I'm literally facing the same issue, did you somehow managed to resolve it?



I though I've been getting this error after invalidating cache and restart Android Studio but it seems to be some kind of different bug from IDE itself.






share|improve this answer





















  • nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
    – Ammar M Mashfj
    Dec 14 at 14:39










  • droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
    – dvlpr
    Dec 15 at 22:08
















0














I'm literally facing the same issue, did you somehow managed to resolve it?



I though I've been getting this error after invalidating cache and restart Android Studio but it seems to be some kind of different bug from IDE itself.






share|improve this answer





















  • nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
    – Ammar M Mashfj
    Dec 14 at 14:39










  • droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
    – dvlpr
    Dec 15 at 22:08














0












0








0






I'm literally facing the same issue, did you somehow managed to resolve it?



I though I've been getting this error after invalidating cache and restart Android Studio but it seems to be some kind of different bug from IDE itself.






share|improve this answer












I'm literally facing the same issue, did you somehow managed to resolve it?



I though I've been getting this error after invalidating cache and restart Android Studio but it seems to be some kind of different bug from IDE itself.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 10 at 22:29









dvlpr

1




1












  • nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
    – Ammar M Mashfj
    Dec 14 at 14:39










  • droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
    – dvlpr
    Dec 15 at 22:08


















  • nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
    – Ammar M Mashfj
    Dec 14 at 14:39










  • droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
    – dvlpr
    Dec 15 at 22:08
















nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
– Ammar M Mashfj
Dec 14 at 14:39




nope , no Answer yet , anyhow I've submitted the bug to google issuetracker.google.com/issues/119838399
– Ammar M Mashfj
Dec 14 at 14:39












droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
– dvlpr
Dec 15 at 22:08




droid version 3.2 is too messed up to resolve unexpected bugs at uncertain times, upgraded to Studio version 3.4 Canary 6 till they make previous versions stable or might stick up to it.
– dvlpr
Dec 15 at 22:08


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403502%2fstrange-error-in-colors-xml-file-in-android-studio%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

To store a contact into the json file from server.js file using a class in NodeJS

Redirect URL with Chrome Remote Debugging Android Devices

Dieringhausen