9

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.

oracleicom
  • 918
  • 4
  • 11
  • 19

2 Answers2

18

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.

oracleicom
  • 918
  • 4
  • 11
  • 19
  • 9
    I lost almost a day with FileNotFound exception, for files inside **assets/someSubfolder**. When I moved the file inside **assets** I got your error. Your solution helped me realize that I was wrong putting **assets** folder inside src/main/res/assets, instead of just **src/main/assets** – dragi Dec 03 '14 at 15:21
1

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/'] } } }
Reyaj
  • 135
  • 1
  • 7