Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio compile error "Content is not allowed in prolog"

I use latest Android Studio 0.8.4 (for OS X), in "res" directory I create new "database" directory and put there all files what I need and when I try to compile I receive this error.

Error:Content is not allowed in prolog. :app:mergeDebugResources FAILED /Users/filipp/data/Android_dev/project/app/src/main/res/database/5clSubject0Book0.txt Error:Error: Content is not allowed in prolog. Error:Execution failed for task ':app:mergeDebugResources'. > /Users/filipp/data/Android_dev/project/app/src/main/res/database/5clSubject0Book0.txt:0:0:   Error: Content is not allowed in prolog. Information:BUILD FAILED 
like image 973
Never_be Avatar asked Aug 05 '14 18:08

Never_be


2 Answers

in "res" directory I create new "database" directory

That is not supported. You cannot invent new resource directories.

Please put the files in res/raw/ (and use via getResources().openRawResource()) or assets/ (and use via getAssets().open()).

like image 175
CommonsWare Avatar answered Sep 22 '22 12:09

CommonsWare


I am having the same problem What I did is,

You need to clear the cache data

Go to Build(Menu)--> Clean Project

Then

Go to Build(Menu)--> Rebuild Project

Then Run Your project

This may also help in refreshing data of android preview

like image 20
Amjad Khan Avatar answered Sep 23 '22 12:09

Amjad Khan