zipalign.exe'' finished with non-zero exit value
Asked Answered
S

3

5

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.

Sporogonium answered 9/5, 2015 at 2:7 Comment(0)
S
4

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

Saccular answered 18/4, 2016 at 6:54 Comment(0)
P
3

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.

Perfusion answered 3/11, 2015 at 9:4 Comment(1)
I had the apk opened with 7zip. Closing it fixed the issue.Paulapauldron
I
0

This happened to me too, when I tried to generate the apk in the following path:

C:\users\desktop

Change your signed generated apk destination path used to generate to the following:

<your project path>\app\build\outputs\apk

Example:

E:\androidStudio\CountDownTimer\app\build\outputs\apk
Interoffice answered 1/7, 2018 at 16:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.