When I upgraded to Android Studio 0.6.1, I encountered a build issue with asset files. I kept getting "Content is not allowed in prolog" during the mergeDebugResources task. Since I couldn't find a suitable answer to this and have since found a solution, I've answered my own question to help other developers who face this issue.
The prolog consists of an XML declaration, possibly followed by a document type declaration. The body is made up of a single root element, possibly with some comments and/or processing instructions. An XML document is typically a computer file whose contents meet the requirements laid out in the XML specification.
It seems that the recent build changes since AS 0.6.1 and AS 0.8.1 no longer ignore custom asset directories. As a result, to get around the dreaded "Content is not allowed in prolog" you'll need to move your font files, properties and xml files to "src/main/assets" instead of your custom mapped assets directory. I hope this helps.
I resolved this issue in this way, first create directory "src/main/assets/fonts" and paste the file then mention this code in build.gradle
android { sourceSets { main { assets.srcDirs = ['src/main/assets/fonts/', 'src/main/assets/fonts/'] } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With