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

原创 2016年06月01日 15:34:53

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

果然,发现aapt这个命令找不到libz.so.1这个依赖,所以接下来解决问题:

(1)查看libz.so.1依赖由谁提供:

[zhangjiayuan@localhost 下载]$ sudo yum whatprovides libz.so.1
[sudo] password for zhangjiayuan:
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
zlib-1.2.7-15.el7.i686 : The compression and decompression library
源    :base
匹配来源:
提供    :libz.so.1

(2)然后安装zlib-1.2.7-15.el7.i686

[zhangjiayuan@localhost 下载]$ sudo yum install zlib-1.2.7-15.el7.i686
已加载插件:fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
adobe-linux-x86_64                                       |  951 B     00:00     
base                                                     | 3.6 kB     00:00     
extras                                                   | 3.4 kB     00:00     
google-chrome                                            |  951 B     00:00     
updates                                                  | 3.4 kB     00:00     
(1/2): extras/7/x86_64/primary_db                          | 132 kB   00:01     
(2/2): updates/7/x86_64/primary_db                         | 4.9 MB   00:07     
(1/2): google-chrome/primary                               | 1.8 kB   00:00     
(2/2): adobe-linux-x86_64/primary                          | 1.2 kB   00:03     
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
adobe-linux-x86_64                                                          2/2
google-chrome                                                               3/3
正在解决依赖关系
--> 正在检查事务
---> 软件包 zlib.i686.0.1.2.7-15.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package         架构            版本                     源               大小
================================================================================
正在安装:
 zlib            i686            1.2.7-15.el7             base             90 k

事务概要
================================================================================
安装  1 软件包

总下载量:90 k
安装大小:180 k
Is this ok [y/d/N]: y
Downloading packages:
zlib-1.2.7-15.el7.i686.rpm                                 |  90 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : zlib-1.2.7-15.el7.i686                                      1/1
  验证中      : zlib-1.2.7-15.el7.i686                                      1/1

已安装:
  zlib.i686 0:1.2.7-15.el7                                                      

完毕!


(3)查看aapt这个命令是否已经解决

[zhangjiayuan@localhost 下载]$ /opt/android-sdk-linux/build-tools/23.0.3/aapt
Android Asset Packaging Tool

Usage:
 aapt l[ist] [-v] [-a] file.{zip,jar,apk}
   List contents of Zip-compatible archive.
......



aapt这个命令已经解决,接下来,重新ionic build android

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

FAILURE: Build failed with an exception.


* What went wrong:
Execution failed for task ':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 1

* 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: 12.562 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


发现了新的问题processDebugResources问题,原因是项目的www/addons/menuDemo/路径下出现了中文文件“说明.txt”,

所以只要更改文件名为英文文件名“readme.txt”即可,

因为修改了代码,所以需要gulp重新构建 并 重新打包:

[zhangjiayuan@localhost moodlemobile2-old]$ gulp

[15:23:39] Using gulpfile ~/moodlemobile2-old/gulpfile.js
[15:23:39] Starting 'build'...
[15:23:39] Starting 'sass-build'...
[15:23:39] Starting 'lang'...
[15:23:39] Finished 'lang' after 58 ms
[15:23:44] Finished 'sass-build' after 4.71 s
[15:23:44] Starting 'sass'...
[15:23:46] Finished 'sass' after 1.72 s
[15:23:46] Finished 'build' after 6.59 s
[15:23:46] Starting 'config'...
[15:23:46] Finished 'config' after 14 ms
[15:23:46] Starting 'default'...
[15:23:46] Finished 'default' after 7.16 μs


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

.....

:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 17.24 secs
Built the following apk(s):
    /home/zhangjiayuan/moodlemobile2-old/platforms/android/build/outputs/apk/android-debug.apk


到此,问题解决。



版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Error:Execution failed for task ':app:processDebugResources'. 的解决办法

Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.Proce...

Error:Execution failed for task ':XXX:processReleaseResources'.

最近在编译项目报这个错,期初gradle console 给的信息很少 FAILURE: Build failed with an exception. What went wrong: Execu...

Error:Execution failed for task ':app:processDebugResources'. 的解决办法

Android Studio项目Build的时候报了这么一个错误: Error:Execution failed for task ':app:processDebugResources' .co...

android 混合编程 :processDebugResources FAILED 错误 中文名称所致

错误信息 如下: Information:Gradle tasks [clean, :CordovaLib:generateDebugSources, :CordovaLib:mockableAndr...

问题Error:Execution failed for task ':weixin:processDebugResources'.

今天更新了android studio 后,创建了一个新的工程,编译的时候报错了. Error:Execution failed for task ':weixin:processDebugReso...

Execution failed app:processDebugResources Android Studio

今天用android studio编译项目的时候,突然报错: Error:Execution failed for task ':app:processDebugResources'. > com....

Error:Execution failed for task ':app:processDebugResources'.解决

下午发现项目里面有个多余的Module,就想着清理一下代码,一清理就出问题了。(我用的是Android Studio) :app:processDebugResources FAILED Error...

Android Studio报错Gradle: Execution failed for task ':MyTest:processDebugResources'.

原先把/res/drawable-hdip里的一张.png图片命名写错,改过后再运行就报出上述错误。 但是图片命名已经修改争取了,只好删除该图片,重新拷贝到/res/drawable-hdip目录下,...

Cordova编译异常小结

java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor versio...

cordova 打包ionic2项目遇到的坑

一    ionic cordova build android的时候报错       报错 1* What went wrong:               A problem occurre...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:CentOS 7下ionic build android 出错 Execution failed for task ':processDebugResources'.
举报原因:
原因补充:

(最多只允许输入30个字)