Android studio 编译错误“内容不允许在序言中" [英] Android studio compile error "Content is not allowed in prolog"
本文介绍了Android studio 编译错误“内容不允许在序言中"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用最新的 Android Studio 0.8.4(适用于 OS X),在res"目录中我创建了新的数据库"目录并将我需要的所有文件放在那里,当我尝试编译时收到此错误.
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
推荐答案
在res"目录中我创建新的数据库"目录
in "res" directory I create new "database" directory
不支持.你不能发明新的资源目录.
That is not supported. You cannot invent new resource directories.
请将文件放在 res/raw/
(并通过 getResources().openRawResource()
使用)或 assets/
(和通过 getAssets().open()
使用).
Please put the files in res/raw/
(and use via getResources().openRawResource()
) or assets/
(and use via getAssets().open()
).
这篇关于Android studio 编译错误“内容不允许在序言中"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文