Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: How can I get the aligned signed release APK?

I'm using Android Studio, and for other projects, when I try to Generate a signed APK I get the app-release.apk file with any further trouble.

But in this particular project, I can only get an app-release-unaligned.apk file.

The main difference with my other projects is the use of the transloadit jar and org.apache.httpcomponents library for which I had to write down the packagingOptions field in my graddle file.

This is my build.grade file

apply plugin: 'com.android.application'

android {
    signingConfigs {
    }
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    defaultConfig {
        applicationId "com.bambinotes.bambinotessnap"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            zipAlignEnabled true
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENCE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('org.apache.httpcomponents:httpmime:4.3.6') {
        exclude module: 'httpclient'
    }
    compile files('libs/transloadit-1.0.2.jar')
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.anupcowkur:reservoir:2.0'
    compile 'com.android.support:cardview-v7:22.2.0'
    compile 'com.android.support:recyclerview-v7:22.2.0'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.mcxiaoke.volley:library:1.0.16'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
    compile 'com.android.support:support-v4:22.2.0'
}

** UPDATE**

I've just found out what was the error that I was having, Android Studio was opening the finder in another folder, the one that generates the app-debug and app-release-unaligned files (which we can consider as intermediate files), the app-release.apk file was two folders up in the directory structure.

Even though I feel embarrassed for knowing the reason of my trouble, I'll leave this question open to see if this happens to anyone else in the future.

like image 480
Lomefin Avatar asked Jul 30 '15 05:07

Lomefin


1 Answers

The app-release.apk file is in the application folder.

Sometimes Android studio shows another directory where the unaligned file is, so you just have to look for the newly created file.

like image 183
Lomefin Avatar answered Oct 26 '22 10:10

Lomefin