2011-04-16 18 views
1

此行爲已在命令行和eclipse新項目上重現。我沒有碰到一件事。在全新的Android項目上使用工具扼流器

aapt p -M AndroidManifest.xml -S res -v 
Locale/Vendor pairs: 
/
/
/
/

Files: 
    drawable-hdpi/icon.png 
     Src: res/drawable-hdpi/icon.png 
    drawable-ldpi/icon.png 
     Src: res/drawable-ldpi/icon.png 
    drawable-mdpi/icon.png 
     Src: res/drawable-mdpi/icon.png 
    layout/main.xml 
     Src: res/layout/main.xml 
    values/strings.xml 
     Src: res/values/strings.xml 
    AndroidManifest.xml 
     Src: AndroidManifest.xml 
applyFileOverlay for drawable 
applyFileOverlay for layout 
applyFileOverlay for anim 
applyFileOverlay for animator 
applyFileOverlay for interpolator 
applyFileOverlay for xml 
applyFileOverlay for raw 
applyFileOverlay for color 
applyFileOverlay for menu 
applyFileOverlay for mipmap 
    (new resource id icon from res/drawable-hdpi/icon.png) 
    (new resource id icon from res/drawable-ldpi/icon.png) 
    (new resource id icon from res/drawable-mdpi/icon.png) 
    (new resource id main from res/layout/main.xml) 
res/layout/main.xml:2: error: No resource identifier found for attribute 'orientation' in package 'android' 
res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_width' in package 'android' 
res/layout/main.xml:2: error: No resource identifier found for attribute 'layout_height' in package 'android' 
res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_width' in package 'android' 
res/layout/main.xml:7: error: No resource identifier found for attribute 'layout_height' in package 'android' 
res/layout/main.xml:7: error: No resource identifier found for attribute 'text' in package 'android' 

在使用2.3.3 SDK運行Android Platform-Tools版本3的64位Ubuntu上。

感謝您的幫助!非常感激!

+0

當你讓Eclipse或'ant'完成正常的構建過程,包括調用'aapt'時會發生什麼? – CommonsWare 2011-04-16 00:20:09

+0

請問我們可以看到res/layout/main.xml嗎? – 2011-04-16 00:28:30

回答

4

您不包含Android框架資源。使用-I選項和where路徑來查找框架資源.apk。

+2

就是這樣。 aapt的文檔說:「 - 我添加一個現有的包到基地包括集」這是大約是模糊和不透明的,因爲它得到。他們實際上在尋找特定平臺的android.jar,它不是生成的項目代碼的一部分。只是爲了像我這樣的其他新生的一個注意。 – 2011-04-16 16:54:30

0

我也有這個錯誤。我的解決方案是在必填字段或變量中填寫完整路徑和android jar的名稱。如果aapk找不到它,這是它報告的錯誤消息。

相關問題