如何在 Android Studio 中构建“发布"APK? [英] How to build a 'release' APK in Android Studio?

查看:58
本文介绍了如何在 Android Studio 中构建“发布"APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个可以上传到 Play 商店的 APK.

I am trying to build an APK that I can upload to the Play Store.

当我在 Android Studio(版本 0.3.1)中选择 Build|Generate Signed APK... 时,我被定向到一个关于如何在gradle build scripts"中正确设置签名过程的链接:

When I select Build|Generate Signed APK... in Android Studio (version 0.3.1), I am directed to a link on how to properly set up the signing process in the "gradle build scripts":

http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations

不幸的是,在检查该页面后,我不知道要编辑什么文件以及要放入什么文件 - 我来自 Visual Studio 背景,所以懒惰地期望东西正常工作":).

Unfortunately, after checking that page I'm at a loss as to what file to edit and what to put in it - I'm coming from a Visual Studio background, so lazily expect stuff to 'just work' :).

(在确定 Android Studio 的警告消息后,AS 调出生成签名的 APK 向导,我通过该向导传递了我的密钥详细信息.生成的 APK 被 Play 商店拒绝,因为密钥与到期日).

(After OK'ing Android Studio's warning message, A.S. brings up a Generate Signed APK Wizard, which I went through, passing my key's details. The resulting APK was rejected by the Play Store for having a key with a too-soon expiry-date).

我还尝试打开 Android Studio 终端窗口并运行gradle",如上述消息中所述,但未找到此命令.顺便说一句,由于运行命令可能会做一些有用的事情,我将如何运行 gradle?

I also tried bringing up the Android Studio Terminal window and running 'gradle', as instructed in the above message, but this command was not found. So as an aside, since perhaps running the command might do something useful, how would I run gradle?

我在 A.S. 中发现了一个Gradle"窗口IDE,并尝试构建在该窗口中找到的 assembleRelease 目标.但是,运行窗口输出仅显示Executing external task 'assembleRelease'...".

I found a 'Gradle' window in the A.S. IDE, and tried building the assembleRelease target found in that window. However, the Run window output just shows "Executing external task 'assembleRelease'...".

推荐答案

请按照以下步骤操作:

-Build
-Generate Signed Apk
-Create new

然后填写New Key Store"表格.如果您想更改 .jnk 文件目的地,请选择目的地并命名以获得确定"按钮.完成后你会得到密钥存储密码"、密钥别名"、密钥密码"按下一步并更改目标文件夹.然后按完成,就是这样.:)

Then fill up "New Key Store" form. If you wand to change .jnk file destination then chick on destination and give a name to get Ok button. After finishing it you will get "Key store password", "Key alias", "Key password" Press next and change your the destination folder. Then press finish, thats all. :)

这篇关于如何在 Android Studio 中构建“发布"APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆