android studio:发布的apk没有签名 [英] android studio: release apk is not signed

查看:113
本文介绍了android studio:发布的apk没有签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

* 自从最初发布后,我已经改写了帖子 *

当我尝试运行刚刚构建的发行版 apk 时,出现错误您当前选择的变体的 apk ......未签名."这是在编辑配置"弹出窗口中.这是我的步骤:

When I try to run a just-built release apk, I get an error "the apk for your currently selected variant ... is not signed." This is in the Edit Configuration popup. Here are my steps:

  1. 在构建变体"选项卡中,选择发布"
  2. 在菜单中,选择 Build -> Generate Signed APK
  3. 在弹出窗口中,填写密钥库和密码字段.
  4. 在第二个面板中,将目标文件夹更改为 ...\app\build\outputs\apk(请参阅下面的注释 *)
  5. 观察工作室右上角的通知:APK 生成成功.
  6. 在菜单中,点击运行 -> 运行应用.
  7. 我收到一个编辑配置"弹出窗口,其中包含错误您当前选择的变体的 apk ... 未签名.

那么,为什么会出现这个错误?生成的 APK 似乎是有效的.我已成功将其发布到 Android 商店(仅限 alpha 测试)并验证堆栈转储已被混淆.

So, why this error? The APK generated appears to be valid. I have successfully posted it to the Android Store (alpha testing only) and verified that stack dumps are obfuscated.

我不能做的是将它(上面的第 6 步)下载到我的设备上.我想没关系,因为我可以下载调试版本就好了.

What I can't do is download it (step 6 above) to my device. I guess that's ok since I can download the debug version just fine.

(*) Android Studio 默认将发布 apk 的输出到更高的,大概更方便的目录.但是我发现当生成的文件分散时更难管理它们的一致性,所以我更喜欢将所有生成的 apk 放在一个地方.

(*) Android Studio defaults the output for the release apk to a higher, presumably more convenient directory. However I find it harder to manage the consistency of generated files when they are scattered about so I prefer all the generated apks in one place.

推荐答案

转到文件\项目结构

完成!;)

这篇关于android studio:发布的apk没有签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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