执行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