简体   繁体   English

Android Studio不会生成zip对齐的apk

[英]Android Studio is not generating zip aligned apk

I am using Android Studio 1.2.2 我使用的是Android Studio 1.2.2

My sdk is well updated and build-tools version installed is 22.0.1 我的sdk更新得很好,安装的build-tools版本是22.0.1

Build > Generate Signed Apk

I only get app-release-unaligned.apk in (app/build/outputs/apk/) 我只能在(app / build / outputs / apk /)中获得app-release-unaligned.apk

I have already googled and tried: 我已经谷歌搜索并尝试:

  1. Copy Pasting "zipalign.exe" from build-tools folder to : (i) sdk/tools/ (ii) sdk/platform-tools/ 将buildal tools文件夹中的“zipalign.exe”粘贴到:(i)sdk / tools /(ii)sdk / platform-tools /

  2. Adding "zipAlignEnabled true" under buildTypes in build.gradle 在build.gradle中的buildTypes下添加“zipAlignEnabled true”

  3. Gradle zipAlign task not working? Gradle zipAlign任务不起作用?

Please help solve this issue, I want to zipalign using Android Studio. 请帮忙解决这个问题,我想使用Android Studio进行zipalign。

This is my first app i am trying to publish !!! 这是我试图发布的第一个应用程序!

It is pretty easy to generate the signed apk file with Android Studio. 使用Android Studio生成签名的apk文件非常容易。

Here are the steps: 以下是步骤:

在此输入图像描述

在此输入图像描述

在此输入图像描述

You probably are generating it, but the release .apk file is placed in a different directory from the other .apk files. 您可能正在生成它,但是发布的.apk文件放在与其他.apk文件不同的目录中。

On my system, for an app called TheApp, .apk files are usually placed in the build/outputs/apk directory: 在我的系统上,对于一个名为TheApp的应用程序, .apk文件通常放在build/outputs/apk目录中:

TheApp/build/outputs/apk/TheApp-debug.apk
TheApp/build/outputs/apk/TheApp-debug-unaligned.apk
TheApp/build/outputs/apk/TheApp-release-unaligned.apk

but the aligned release .apk file is placed directly in the app's root directory : 但对齐的.apk文件直接放在应用程序的根目录中:

TheApp/TheApp-release.apk

(This was already answered by @yushulx but I hope this shorter answer is clearer). (这已经被@yushulx回答了,但我希望这个更短的答案更清晰)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM