Android Studio:安装失败,因为 APK 未签名 [英] Android Studio: Installation failed since APK was not signed

查看:122
本文介绍了Android Studio:安装失败,因为 APK 未签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在模拟器中运行我的应用程序,但收到以下错误:

I am attempting to run my app in an emulator and have been receiving the following error:

安装失败,因为 APK 未签名或签名不正确.如果这是基于 Gradle 的项目,请确保在 Gradle 构建脚本中指定签名配置.

Installation failed since the APK was either not signed, or signed incorrectly. If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.

我正在尝试使用调试设置运行应用程序,因此不需要对应用程序进行签名,因为它会在构建时获得临时签名.

I am attempting to run the app with a debug setting so signing the app should not be necessary as it will be given a temporary signature upon building.

推荐答案

这个问题可以通过以下两种方式解决

This problem can be resolved by below two ways

  1. 将内置变体更改为调试
  2. 定义您的应用程序的signingConfigs

当您在调试模式下构建应用程序时,第一个解决方案有效.但是,一旦您准备好在 Google Play 商店上发布您的应用程序,您就需要通过第二种方式.

First solution works when you built your application in debug mode. But, once you are ready to publish your application on Google Play store you need to go by second way.

阅读更多 -> 签署您的应用

希望这对所有人都有帮助!

Hope this will help one and all!

这篇关于Android Studio:安装失败,因为 APK 未签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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