I run Intellij, and when I try to run an android app, I always have an internal error: Content is not allowed in prolog. I think that I have tried everything to fix it, but
Check first line of xml files in .idea folder. Remove their content if error is given by intellij. They will be regenerated by intellij. And everything will work fine then.
This usually happens when you have added some syntactically incorrect characters to an XML file in the very first line
which should always be
<?xml version="1.0" encoding="utf-8"?>
(prolog)
Just Open Workspace.XMl and check is there any In-Valid XML content. Or else delete all from Workspace.xml and compile again.
I can't see anything specific to the AndroidManifest in there. Maybe one of your project files is corrupt?
Appears to be the same as this question: Android Studio Issue - Premature end of file
I have faced this issue today and tried all the solutions given here but nothing helped out. Post spending a day, realized the mistake I did.
I am using intellij community addition and configured external tomcat-9.0.24 via Tomcat Runner plugin. The tomcat is external to intellij whose path needs to be provided in TomcatRunner. The issue is with server.xml of this external tomcat. The content of server.xml is replaced with some junk data which I couldn't identified.
I am sharing this to make others also know that this error can also be caused in any xmls of your server(Tomcat) not just with the xmls of .idea folder.