Android Studio:如何获得对齐的签名版APK?

Lom*_*fin 5 android gradle apk

我正在使用Android Studio,而对于其他项目,当我尝试生成已签名的APK时,我会app-release.apk更加困难地获取该文件.

但在这个特定的项目中,我只能得到一个app-release-unaligned.apk文件.

与我的其他项目的主要区别是使用transloadit jar和org.apache.httpcomponents库,我必须在我的graddle文件中写下packagingOptions字段.

这是我的build.grade文件

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'
}
Run Code Online (Sandbox Code Playgroud)

**更新**

我刚刚发现我遇到的错误是什么,Android Studio在另一个文件夹中打开finder,生成app-debug和app-release-unaligned文件(我们可以将其视为中间文件), app-release.apk文件是目录结构中的两个文件夹.

即使我因为知道我的麻烦的原因而感到尴尬,但我会留下这个问题,看看将来是否会发生这种情况.

Lom*_*fin 12

app-release.apk文件位于应用程序文件夹中.

有时Android Studio会显示未对齐文件所在的另一个目录,因此您只需查找新创建的文件即可.