【问题标题】:Cannot run program "aapt"无法运行程序“aapt”
【发布时间】:2016-04-28 10:18:59
【问题描述】:

我正在尝试使用终端对 android apk 进行签名和压缩对齐,但出现以下异常。

java.io.IOException: Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(Unknown Source)
        at com.comarch.certificategenerator.GeneratorMainWindow.getPackageInfo(Unknown Source)
        at com.comarch.certificategenerator.GeneratorMainWindow.generateAppId(Unknown Source)
        at com.comarch.certificategenerator.GeneratorMainWindow.main(Unknown Source)
        at com.comarch.certificategenerator.Main.main(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 5 more            
Executing: 

我试图找到但不明白为什么会出现此错误。

【问题讨论】:

    标签: android apk aapt zipalign


    【解决方案1】:

    来自 Oracle 文档:“验证 ADF 移动平台页面的 Android 构建工具位置字段中定义的位置是否引用了包含 aapt 文件(Windows 系统上为 aapt.exe)的目录。适用于 Android SDK 的修订版 22 ,此文件以及所有其他构建工具组件位于 build-tools 目录中。对于早期版本,构建工具组件位于 platform-tools 目录中。"

    可能,如果您已更新您的 android 构建工具,位置错误,必须在平台工具中更改。

    如果您在 linux 系统下运行,可能缺少 32 位库:尝试使用
    @987654321 @

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-05
      • 2014-11-13
      • 2016-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多