:CordovaLib:processDebugResources FAILED

时间:2016-04-10 11:45:17

标签: android cordova ionic-framework centos7

使用ionic构建Android应用程序:

[root@localhost ionic-app-base-master]# ionic build android

控制台日志显示这些消息:

Running command: /root/ionic-tutorial/conference/ionic-app-base-master/hooks/after_prepare/010_add_platform_class.js /root/ionic-tutorial/conference/ionic-app-base-master
    add to body class: platform-android
    ANDROID_HOME=/usr/local/lib/android-sdk
    JAVA_HOME=/usr/java/jdk1.8.0_45
    :preBuild UP-TO-DATE
    :preDebugBuild UP-TO-DATE
    :checkDebugManifest
    :CordovaLib:preBuild UP-TO-DATE
    :CordovaLib:preDebugBuild UP-TO-DATE
    :CordovaLib:compileDebugNdk UP-TO-DATE
    :CordovaLib:compileLint
    :CordovaLib:copyDebugLint UP-TO-DATE
    :CordovaLib:mergeDebugProguardFiles UP-TO-DATE
    :CordovaLib:packageDebugRenderscript UP-TO-DATE
    :CordovaLib:checkDebugManifest
    :CordovaLib:prepareDebugDependencies
    :CordovaLib:compileDebugRenderscript UP-TO-DATE
    :CordovaLib:generateDebugResValues UP-TO-DATE
    :CordovaLib:generateDebugResources UP-TO-DATE
    :CordovaLib:packageDebugResources UP-TO-DATE
    :CordovaLib:compileDebugAidl UP-TO-DATE
    :CordovaLib:generateDebugBuildConfig UP-TO-DATE
    :CordovaLib:generateDebugAssets UP-TO-DATE
    :CordovaLib:mergeDebugAssets UP-TO-DATE
    :CordovaLib:processDebugManifest UP-TO-DATE
    :CordovaLib:processDebugResources FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':CordovaLib:processDebugResources'.
    > A problem occurred starting process 'command '/usr/local/lib/android-sdk/build-tools/23.0.2/aapt''

    * 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: 2.503 secs
    Error: Error code 1 for command: /root/ionic-tutorial/conference/ionic-app-base-master/platforms/android/gradlew with args: cdvBuildDebug,-b,/root/ionic-tutorial/conference/ionic-app-base-master/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

我查了很多门票&我执行了很多更改,例如:

  1. https://stackoverflow.com/a/30842231/747579

  2. Conflict with android support version on cordova build android

  3. https://forum.ionicframework.com/t/ionic-android-build-problem/29131/5

  4. 已知当前config.xml为:

    <?xml version='1.0' encoding='utf-8'?>
    <widget id="com.ionicframework.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
        <name>HelloCordova</name>
        <description>
            An Ionic Framework and Cordova project.
        </description>
        <author email="me@abdennoor.com" href="http://abdennoor.com">
          Abdennour TOUMI
        </author>
        <content src="index.html" />
        <access origin="*" />
        <preference name="webviewbounce" value="false" />
        <preference name="UIWebViewBounce" value="false" />
        <preference name="DisallowOverscroll" value="true" />
    
        <!-- Ionic supports Android Jellybean and up --> 
        <preference name="android-minSdkVersion" value="16" />
    
        <!-- Don't store local data in an iCloud backup. Turn this to "cloud" to enable storage 
             to be sent to iCloud. Note: enabling this could result in Apple rejecting your app.
        -->
        <preference name="BackupWebStorage" value="none" />
    
        <feature name="StatusBar">
          <param name="ios-package" value="CDVStatusBar" onload="true" />
        </feature>
    </widget>
    

    我的环境:

       Android SDK   :  23.1.0
       Ionic         : 1.7.4
       Cordova       : 6.1.0
       gradle        : 2.2.1
       JVM           : 1.8.0_45 (Oracle Corporation 25.45-b02)
    
       Groovy        : 2.3.6
       Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
       OS:           Linux 3.10.0-327.10.1.el7.x86_64 amd64
    

2 个答案:

答案 0 :(得分:4)

也许您正试图在64位系统上运行Android SDK(安装在32位文件上)。 我解决了在Ubuntu上运行命令的问题。根据您的系统,尝试以下选项之一:

如果您使用的是Ubuntu 32位版本

  

sudo apt-get install libgl1-mesa-dev

如果您的Ubuntu是64位且其版本是&lt; = 13.04,请运行:

  

sudo apt-get install ia32-libs

如果是Ubuntu 64bit且版本&gt; = 13.10,请运行:

  

sudo apt-get install libgl1-mesa-dev:i386

答案 1 :(得分:0)

检查您的文件名,我遇到了同样的问题,并通过从文件名中删除特殊字符来解决。