Aapt 工具在一个全新的 Android 项目中卡住了

发布于 2024-11-01 20:40:17 字数 1744 浏览 1 评论 0原文

此行为已在命令行和 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'

在 64 位 Ubuntu 上运行 Android Platform-Tools 版本 3 和 2.3.3 SDK。

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

This behavior has been reproduced on both a command-line and an eclipse new project. I have not touched a thing.

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'

On 64-bit Ubuntu running Android Platform-Tools version 3 with 2.3.3 SDK.

Thanks for your help! Much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

游魂 2024-11-08 20:40:17

您没有包含 Android 框架资源。使用 -I 选项以及查找框架资源 .apk 的路径。

You are not including the Android framework resources. Use the -I option with the path of where to find the framework resources .apk.

等风来 2024-11-08 20:40:17

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

I got this error, too. My solution was to fill in the full path AND the name of the android jar in the required field or variable. If aapk can't find it this is the error message it reports.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文