CentOS 7下ionic build android 出错 Execution failed for task ':processDebugResources'.

在执行`ionic build android`时遇到`Execution failed for task ':CordovaLib:processDebugResources'`错误,由于`aapt`命令找不到`libz.so.1`依赖。通过`yum`安装`zlib`后,问题仍未解决,发现是项目目录下存在中文文件导致的新问题。将中文文件名改为英文并重新构建及打包后,成功完成`ionic build android`。
摘要由CSDN通过智能技术生成

执行ionic build android:

[zhangjiayuan@localhost moodlemobile2-old]$ ionic build android


错误如下:

:CordovaLib:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-linux/build-tools/23.0.3/aapt'' finished with non-zero exit value 127

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.532 secs
Error: Error code 1 for command: /home/zhangjiayuan/moodlemobile2-old/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/zhangjiayuan/moodlemobile2-old/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

仔细看问题:Process 'command '/opt/android-sdk-linux/build-tools/23.0.3/aapt''

原因是aapt这个命令找不到,

那么尝试在终端执行:

[zhangjiayuan@localhost 下载]$ /opt/android-sdk-linux/build-tools/23.0.3/aapt
/opt/android-sdk-linux/build-tools/23.0.3/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dire

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值