5
votes

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.

3

3 Answers

4
votes

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

3
votes

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.

0
votes

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