[英]XML not well formed
I am trying to build my android app and it is throwing the error: 我正在尝试构建我的Android应用程序,它抛出错误:
Error:(1) Error parsing XML: not well-formed (invalid token)
I did some research on Stack and people had a similiar probelm when they mixed xml and java. 我对Stack进行了一些研究,当人们混合使用xml和java时,他们有一个类似的问题。 After looking at the error it is throwing it for an .png file I am using which doesnt make much sense to me.
在查看错误后,它将它丢弃为我正在使用的.png文件,这对我来说没有多大意义。
Here is a some more of the error showing: 这是一个更多的错误显示:
Error:(1) Execution failed for task ':BeerPprtfolio:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/Mike/Documents/adt-bundle-mac-x86_64-20140321/sdk/build-tools/19.1.0/aapt package -f --no-crunch -I /Users/Mike/Documents/adt-bundle-mac-x86_64-20140321/sdk/platforms/android-21/android.jar -M /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/res/debug -A /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/assets/debug -m -J /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/generated/source/r/debug -F /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.beerportfolio.beerportfoliopro -0 apk --output-text-symbols /Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/symbols/debug
Error Code:
1
Output:
/Users/Mike/Documents/beerPortfolio/beerportfoliov3/BeerPprtfolio/build/intermediates/res/debug/layout/ic_drawer.png:1: error: Error parsing XML: not well-formed (invalid token)
error: Error parsing XML: not well-formed (invalid token)
错误:解析XML时出错:格式错误(无效令牌)
Because adding ic_drawer.png
image in res/layout
folder but res/layout
folder is used for placing layouts for screens in xml. 因为在
res/layout
文件夹中添加了ic_drawer.png
图像,但res/layout
文件夹用于在xml中放置屏幕的布局。
Move ic_drawer.png
file in drawable
folder. 将
ic_drawer.png
文件移动到drawable
文件夹中。
Also in code and xml files make sure not getting ic_drawer.png
as R.layout.ic_drawer
because ic_drawer
is image so use R.drawable.ic_drawer
for getting id of ic_drawer.png
in code or xml 同样在代码和xml文件中,请确保不要将
ic_drawer.png
作为R.layout.ic_drawer
获取,因为ic_drawer
是图像所以使用R.drawable.ic_drawer
获取代码或xml中的ic_drawer.png
id
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.