gradlew build freezing at mergeDebugResources
Asked Answered
C

2

9

I build debug app use gradlew as in google tutorial https://developer.android.com/training/basics/firstapp/running-app.html

I was created project use

android create project --target 2 -g -v 2.9--name myAppName --path ./MyAppDirectory --activity MyActivity --package com.mypackage

and this is my build.gradle file

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

apply plugin: 'android'

android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion '23.0.2'

buildTypes {
    release {
        //runProguard false
          //minifyEnabled true
        proguardFile getDefaultProguardFile('proguard-android.txt')
    }
}
}

I build debug app use command

$ ./gradlew assembleDebug

and building is freezing at 40% as

    :preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources
java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 4 more
java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
Thread(png-cruncher_5) has a null payload
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 4 more
Thread(png-cruncher_3) has a null payload
java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 4 more
Thread(png-cruncher_2) has a null payload
java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 4 more
Thread(png-cruncher_1) has a null payload
java.io.IOException: Cannot run program "/home/kanoonsantikul/android-sdk-linux/build-tools/23.0.2/aapt": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
    at com.android.builder.png.AaptProcess$Builder.start(AaptProcess.java:163)
    at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:106)
    at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
    ... 4 more
> Building 40% > :mergeDebugResources

`

Cons answered 23/11, 2015 at 20:8 Comment(3)
Run the android sdk manager and install builds tools 23.0.2Solorio
I have the same issue, and build tools 23.0.2 is installed. The file about Gradle complains exists, so &#!!+@#!!!! >:( I can't imagine what the problem could be. It runs perfectly on my machine, and gives this error on the build server.Sandpaper
I came across the same problem, "... has a null payload" and the generic Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application. I uninstalled java/intellij, but only when I switched into build tools 27.0.0 did the issue get resolved.Nonfiction
H
9

Most likely you have a 64bit system and still some 32bits are missing for android development.

If you're running on a 64bit-Ubuntu system, see 32-bit-libs for Ubuntu 64-bit Android Development for further details.

If you're running on a 64bit-Fedora system, see installing-android-sdk-on-64-bit-fedora/ for further details.

Hg answered 1/1, 2016 at 17:56 Comment(0)
I
0

Fixed it by installing the libraries

sudo apt-get install lib32z1

sudo apt-get install zlib1g:i386

Iotacism answered 3/8, 2018 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.