[英]XML not well formed
我正在嘗試構建我的Android應用程序,它拋出錯誤:
Error:(1) Error parsing XML: not well-formed (invalid token)
我對Stack進行了一些研究,當人們混合使用xml和java時,他們有一個類似的問題。 在查看錯誤后,它將它丟棄為我正在使用的.png文件,這對我來說沒有多大意義。
這是一個更多的錯誤顯示:
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)
錯誤:解析XML時出錯:格式錯誤(無效令牌)
因為在res/layout
文件夾中添加了ic_drawer.png
圖像,但res/layout
文件夾用於在xml中放置屏幕的布局。
將ic_drawer.png
文件移動到drawable
文件夾中。
同樣在代碼和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.