android - Aapt 工具在一个全新的 Android 项目上卡住了

标签 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'

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

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

最佳答案

您没有包括 Android 框架资源。将 -I 选项与查找框架资源 .apk 的路径一起使用。

关于android - Aapt 工具在一个全新的 Android 项目上卡住了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5683488/

相关文章:

android - 异常 : View does not have a navController set

android - fragment 在 ViewPager 中无法正确显示

android - 在android终端中遇到一个bug

android - 在不修改纵横比的情况下更改位图尺寸

Android- mailto 链接不起作用

linux - 类型错误执行 aapt : Cannot run program "/opt/android-sdk-linux/build-tools/19.0.1/aapt": java. io.IOException

java - aapt 使用 Runtime.exec()

java - Android 打包问题 "error: Error: No resource found that matches the given name "

java - 直接在手机上运行 "aapt.exe"?

android - 手动(aapt)将 native 库.so添加到apk