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 ':XXX:processReleaseResources'.

最近在编译项目报这个错,期初gradle console 给的信息很少 FAILURE: Build failed with an exception. What went wrong: Execu...
  • u013555324
  • u013555324
  • 2016年06月03日 15:00
  • 5392

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

Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.Proce...
  • yyh352091626
  • yyh352091626
  • 2015年10月13日 09:34
  • 48345

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

今天更新了android studio 后,创建了一个新的工程,编译的时候报错了. Error:Execution failed for task ':weixin:processDebugReso...
  • sc9018181134
  • sc9018181134
  • 2016年04月13日 09:30
  • 1073

Execution failed for task ':app:processDebugResources'. > java.io.IOException: Could not delete path

Error:Execution failed for task ':app:processDebugResources'. > java.io.IOException: Could not delet...
  • Rgen_xiao
  • Rgen_xiao
  • 2017年02月07日 15:51
  • 8115

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

E:\androidSutio\AndroidStudy\app\build\intermediates\res\merged\debug\values\values.xml Error:(3) T...
  • Dorsey_c
  • Dorsey_c
  • 2015年12月10日 19:34
  • 4522

Error:Execution failed for task ':app:mergeDebugResources'. >\re

今天在androidstudio编译的时候报错 Error:Execution failed for task ':app:mergeDebugResources'....
  • a48702668
  • a48702668
  • 2017年02月14日 19:21
  • 2520

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

今天打开android studio  gradle 运行的时候 突然就报了个错 Error:Execution failed for task ':app:processDebugResource...
  • aengui
  • aengui
  • 2015年11月18日 08:28
  • 2603

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

下午发现项目里面有个多余的Module,就想着清理一下代码,一清理就出问题了。(我用的是Android Studio) :app:processDebugResources FAILED Error...
  • zimolanchen
  • zimolanchen
  • 2016年07月14日 17:03
  • 3506

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

错误信息 如下: Information:Gradle tasks [clean, :CordovaLib:generateDebugSources, :CordovaLib:mockableAndr...
  • u014470581
  • u014470581
  • 2017年01月15日 20:09
  • 1526

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

Android Studio项目Build的时候报了这么一个错误: Error:Execution failed for task ':app:processDebugResources' .co...
  • opshres169
  • opshres169
  • 2016年06月27日 23:59
  • 3308
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:CentOS 7下ionic build android 出错 Execution failed for task ':processDebugResources'.
举报原因:
原因补充:

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