我已经阅读了其他人的答案,但我无法弄明白......请帮助我。 当我厌倦了将我的启动画面图像复制到res文件夹...复制文件后我收到了这个错误
home/nteam/OrderliteProject/Orderlite/app/src/main/res/xxxhdpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
/home/nteam/OrderliteProject/Orderlite/app/src/main/res/hdpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
/home/nteam/OrderliteProject/Orderlite/app/src/main/res/xxhdpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
/home/nteam/OrderliteProject/Orderlite/app/src/main/res/mdpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
/home/nteam/OrderliteProject/Orderlite/app/src/main/res/ldpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
/home/nteam/OrderliteProject/Orderlite/app/src/main/res/xhdpi/sp_bg.png
Error:(1, 1) Error: Content is not allowed in prolog.
:app:mergeDebugResources FAILED
我也试图删除这些图像并尝试重新编译它但我钢铁得到同样的错误。请帮帮我。
答案 0 :(得分:13)
/res
中的目录名无效。 Drawable
资源的有效目录名以drawable-
开头。例如,drawable-xxxhdpi
,drawable-xxhdpi
,drawable-xhdpi
等