Android Release Build Error



  • Hello,

    i have the following error output when trying to build my release app for android

    Fetch queue Info...
    Start building 583411b8013eb02d1efc0f04
    Setup working directories...
    Download project archive...
    Extract project archive...
    Fetch project info...
    Webview:default
    Arch:null
    cordova version: 6.2.0
    
    
    - preBuild -
    buildForAndroid
    
    - Cordova create -
    $ /data/build-server/cordova/6.2.0/bin/cordova create /tmp/monaca/583411b8013eb02d1efc0f04/project
    Creating a new cordova project.
    
    
    - Copy .monaca-res directory -
    
    - Cordova platform add -
    $ /data/build-server/cordova/6.2.0/bin/cordova platform list
    $ /data/build-server/cordova/6.2.0/bin/cordova platform add /data/build-server/cordova/platforms/android/5.1.1
    Adding android project...
    Creating Cordova project for the Android platform:
        Path: platforms/android
        Package: io.cordova.hellocordova
        Name: HelloCordova
        Activity: MainActivity
        Android target: android-23
    Android project created with cordova-android@5.1.1
    Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
    Fetching plugin "cordova-plugin-whitelist@1" via npm
    Installing "cordova-plugin-whitelist" for android
    
                   This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
              
    
    
    - Copy config.xml -
    
    - Copy files for signing -
    
    - Copy www files -
    
    - Cordova plugin add -
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add mobi.monaca.plugins.Monaca
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-plugin-whitelist@1.2.2
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-plugin-splashscreen@3.2.2
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-custom-config@2.0.3
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-plugin-inappbrowser@1.4.0
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-plugin-statusbar@2.1.3
    $ /data/build-server/cordova/6.2.0/bin/cordova plugin add cordova-plugin-network-information@1.2.1
    
    - Cordova prepare -
    $ /data/build-server/cordova/6.2.0/bin/cordova prepare android
    cordova-custom-config: Skipping auto-restore of config file backup(s)
    
    
    - Cordova compile -
    $ /data/build-server/cordova/6.2.0/bin/cordova compile --release --device
    ANDROID_HOME=/data/android-sdk
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
    :preBuild UP-TO-DATE
    :preReleaseBuild UP-TO-DATE
    :checkReleaseManifest
    :CordovaLib:preBuild UP-TO-DATE
    :CordovaLib:preReleaseBuild UP-TO-DATE
    :CordovaLib:compileReleaseNdk UP-TO-DATE
    :CordovaLib:compileLint
    :CordovaLib:copyReleaseLint UP-TO-DATE
    :CordovaLib:mergeReleaseProguardFiles
    :CordovaLib:packageReleaseRenderscript UP-TO-DATE
    :CordovaLib:checkReleaseManifest
    :CordovaLib:prepareReleaseDependencies
    :CordovaLib:compileReleaseRenderscript
    :CordovaLib:generateReleaseResValues
    :CordovaLib:generateReleaseResources
    :CordovaLib:packageReleaseResources
    :CordovaLib:compileReleaseAidl
    :CordovaLib:generateReleaseBuildConfig
    :CordovaLib:generateReleaseAssets UP-TO-DATE
    :CordovaLib:mergeReleaseAssets
    :CordovaLib:processReleaseManifest
    :CordovaLib:processReleaseResources
    :CordovaLib:generateReleaseSources
    :CordovaLib:compileReleaseJavaWithJavac
    :CordovaLib:processReleaseJavaRes UP-TO-DATE
    :CordovaLib:transformResourcesWithMergeJavaResForRelease
    :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
    :CordovaLib:mergeReleaseJniLibFolders
    :CordovaLib:transformNative_libsWithMergeJniLibsForRelease
    :CordovaLib:transformNative_libsWithSyncJniLibsForRelease
    :CordovaLib:bundleRelease
    :prepareAndroidCordovaLibUnspecifiedReleaseLibrary
    :prepareReleaseDependencies
    :compileReleaseAidl
    :compileReleaseRenderscript
    :generateReleaseBuildConfig
    :generateReleaseAssets UP-TO-DATE
    :mergeReleaseAssets
    :generateReleaseResValues
    :generateReleaseResources
    :mergeReleaseResources
    AAPT: libpng error: Read Error
    :mergeReleaseResources FAILED
    
    BUILD FAILED
    
    Total time: 3.597 secs
    
    
    - postBuild -
    Remove working directories...
    Build Error: Error: Sandbox Exec Error: [ 注意:一部の入力ファイルは非推奨のAPIを使用またはオーバーライドしています。
    注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
    AAPT err(Facade for 837626732) : No Delegate set : lost message:libpng error: Read Error
    AAPT err(Facade for 2113661115) : No Delegate set : lost message:libpng error: Read Error
    AAPT err(Facade for 296211492) : No Delegate set : lost message:libpng error: Read Error
    AAPT err(Facade for 837626732) : No Delegate set : lost message:libpng error: Read Error
    AAPT err(Facade for 822960555) : No Delegate set : lost message:libpng error: Read Error
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':mergeReleaseResources'.
    > Crunching Cruncher screen.9.png failed, see logs
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Error: Error code 1 for command: /private/tmp/monaca/583411b8013eb02d1efc0f04/project/platforms/android/gradlew with args: cdvBuildRelease,-b,/private/tmp/monaca/583411b8013eb02d1efc0f04/project/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
     ]
    
    

    can somebody help me please?



  • @minze So it failed with libpng when it attempted to read your 9 patch png file for Crunching. A quick search turned up quite a few results for this error not related to Monaca. It seems the most successful post was: http://stackoverflow.com/questions/30764604/execution-failed-for-task-appmergedebugresources-crunching-cruncher-png-fa

    I would see if any of those resolve it and then go from there.


  • Monaca

    I have seen this or a similar issue in the past and the source that @munsterlander linked gives some very good hints about how to solve it. In my case, I just resaved the image and replaced the original one.


Log in to reply