Migrating from Eclipse to Android Studio Error Content not allowed in prolog

I have seen many mentions of this problem, but most say that this happens periodically. For me, I can’t compile or run my application at all. Build error, and it always exists.
I also saw stack exchange issues, stating that this is due to the version of Gradle, and it just needs to be updated in the build.gradle file. I am already using a much newer version than most of these questions. This seems to be an error caused by my resource files, including all my drawings and lines.

Please note that this project works fine in Eclipse, it works for me on hardware. When I import it into Studio, I get errors.

I have tried the following. -Restaurant studio -Clean Project, then rebuild -Create resource files in everything else in the file system inside the project

Information:Gradle tasks [:app:compileDebugSources]
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
Error:Content is not allowed in prolog.
:app:mergeDebugResources FAILED
C:\Users\jezell\Documents\AndroidStudioProjects\DefenderHud\app\src\main\res\drawable_hdpi\app_setup.png
Error:Error: Content is not allowed in prolog.
Error:Execution failed for task ':app:mergeDebugResources'.
> C:\Users\jezell\Documents\AndroidStudioProjects\DefenderHud\app\src\main\res\drawable_hdpi\app_setup.png:0:0: Error: Content is not allowed in prolog.
Information:BUILD FAILED
Information:Total time: 2 mins 37.404 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console
+4
source share
1 answer

The solution to this problem was to rename all incorrectly named files, in detail capital letters in lower case (for example, ​vert_line_test.PNGto vert_line_test.png), etc.

+1
source

All Articles