Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zipalign.exe'' finished with non-zero exit value

I'm a student programmer and I'm continuing an Android project that has been previously started by other students before me. My problem is that I'm getting an error when I try to execute the Android app inside Android Studio. You can see the error message below. The compilation must have worked for the other students since I have an apk file. What's wrong with zipalign?

:app:zipalignDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:zipalignDebug'.
> Process 'command 'X:\Sdk Android Studio\build-tools\21.1.2\zipalign.exe'' 
finished with non-zero exit value -1073741502

My build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "csf.dfc.friendtracker"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile files('libs/guava-18.0.jar')
    compile files('libs/Pubnub-Android-3.7.2.jar')
    compile files('libs/mysql-connector-java-5.1.34-bin.jar')
}

EDIT: I haven't found the cause of the error but I added all the project objects in a new one and the error disappeared.

like image 510
snorkyller Avatar asked May 09 '15 02:05

snorkyller


2 Answers

Remove the apk file in the Deploy directory and the export worked fine then.

like image 105
Eli Elezra Avatar answered Nov 12 '22 06:11

Eli Elezra


I realized this happen when you have the directory "..\app\build\outputs\apk\" open in your Windows Explorer. You just need to close it and rebuild the project.

like image 36
You Qi Avatar answered Nov 12 '22 06:11

You Qi