Android的工作室编译错误"内容未在序言&QUOT允许的; [英] Android studio compile error "Content is not allowed in prolog"

查看:132
本文介绍了Android的工作室编译错误"内容未在序言&QUOT允许的;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用最新的Andr​​oid 0.8.4工作室(适用于OS X),在资源目录下创建新的数据库目录,并把那里所有的文件我需要什么,当我尝试编译我收到此错误。

 错误:内容是不允许的序言。
:应用:mergeDebugResources失败
/Users/filipp/data/Android_dev/project/app/src/main/res/database/5clSubject0Book0.txt
错误:错误:内容是不允许的序言。
错误:执行失败的任务:应用程序:mergeDebugResources。
> /Users/filipp/data/Android_dev/project/app/src/main/res/database/5clSubject0Book0.txt:0:0:错误:内容是不是在序言中不允许的。
资料:构建失败

请帮忙。


解决方案

  

在资源目录下创建新的数据库目录


这是不支持的。你不能创造新的资源目录。

请把文件 RES /生/ (并通过 getResources使用()。openRawResource())或资产/ (并通过使用 getAssets()的open())。

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

Please help.

解决方案

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()).

这篇关于Android的工作室编译错误"内容未在序言&QUOT允许的;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆