Aapt工具在一个全新的Android项目上窒息

时间:2011-04-16 00:01:52

标签: android aapt

此行为已在命令行和eclipse新项目中重现。我没有触及任何事情。

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'

在运行Android平台工具版本3和2.3.3 SDK的64位Ubuntu上运行。

感谢您的帮助!非常感谢!

2 个答案:

答案 0 :(得分:4)

您未包含Android框架资源。使用-I选项以及查找框架资源.apk。

的路径

答案 1 :(得分:0)

我也遇到了这个错误。我的解决方案是在必填字段或变量中填写完整路径和android jar的名称。如果aapk无法找到,则这是它报告的错误消息。