Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is app-release.apk zipaligned apk?

I am using Android Studio 1.0.2. When I click assembleRelease in gradle tasks, two files are generated, app-release-unaligned.apk and app-release.apk. I know app-release-unaligned.apk is unaligned but what is app-release.apk? Is it aligned apk? My build.gradle is like below.

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        signingConfig signingConfigs.config
        zipAlignEnabled true // Is this necessary or not in Android Studio 1.0.2?
    }
}

Even if I didn't put zipAlignEnabled true, app-release.apk is generated. Is it still necessary in Android Studio 1.0.2? All information I get about zipalign is before Android Studio 1.0 comes out.

like image 247
user3152056 Avatar asked Jan 14 '15 14:01

user3152056


People also ask

What is app release APK?

With a release, you can manage your app's Android App Bundle (or APK for apps created before August 2021) and then roll out your app to a specific track.

What is the use of Zipalign?

zipalign is a zip archive alignment tool. It ensures that all uncompressed files in the archive are aligned relative to the start of the file. This allows those files to be accessed directly via mmap(2) , removing the need to copy this data in RAM and reducing your app's memory usage.

What is APK how you can prepare your app for release?

When you are finished preparing your application for release you have a signed APK file, which you can distribute directly to users or distribute through an application marketplace such as Google Play. This document summarizes the main tasks you need to perform to prepare your application for release.


2 Answers

You don't need to set that flag.

From official guide

The possible properties and their default values are:

enter image description here

like image 84
gio Avatar answered Sep 20 '22 14:09

gio


It is both aligned and signed. Ready for publication.

AFAIK zipAlignEnabled is true by default for release builds.

like image 26
shkschneider Avatar answered Sep 21 '22 14:09

shkschneider