微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决Aapt工具在一个全新的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平台工具版本3的64位Ubuntu上。 谢谢你的帮助!非常感激!     

解决方法

您不包括Android框架资源。将-I选项与找到框架资源.apk的路径一起使用。     ,我也遇到了这个错误。我的解决方案是在必填字段或变量中填写完整路径和android jar的名称。如果aapk找不到,这是它报告的错误消息。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。