两种不同的机器人工作室,但同一个项目中,他们是产生不同? [英] Two different android studio but same project, are they generated differently?

查看:107
本文介绍了两种不同的机器人工作室,但同一个项目中,他们是产生不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的电脑有双启动Ubuntu的/ Windows和我的项目是github上。通常我用code在Ubuntu的android工作室。不过,昨天我把我的项目到Windows的Andr​​oid工作室从GitHub,当我编译了该项目,而一个设备它说上安装

My laptop has dual boot Ubuntu/Windows and my project is in github. Usually I used to code in ubuntu's android studio. But yesterday I pulled my project to windows android studio from github and when I compiled the project while installing on a device it said

失败[INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

这是什么意思?

在此先感谢!

推荐答案

在部署应用到设备或模拟器中,APK需要与从Java密钥库密钥签名。

When you deploy an app to a device or the emulator, the APK needs to be signed with a key from a Java keystore.

您通常,当你想你的应用程序上传到Play商店第一次遇到了这个过程。在这样做之前,你必须与你将用来签署所有将来的发布版本的关键签署APK。您通常生成此密钥自己,你不能失去它 - 没有它,你不能释放你的应用程序的新版本。

You typically first encounter this process when you want to upload your app to the Play Store. Before doing so, you must sign your APK with a key that you will use to sign all future release builds. You typically generate this key yourself, and you cannot lose it- without it, you cannot release a new version of your app.

不过,调试开发过程中建立也必须签署部署到设备。美中不足的是,在默认情况下,调试版本与当你第一次设置你的开发环境,生成密钥库调试签署。正因为如此,调试密钥库是每台计算机上不同,当您尝试安装从不同的计算机应用程序,设备将理所当然地抱怨说,它已安装应用程序不具有相同的证书作为新版本你想安装。

However, debug builds during development must also be signed to deploy to a device. The catch is that by default, debug builds are signed with a debug keystore that is generated when you first set up your development environment. Because of this, the debug keystore is different on every computer, and when you try to install your application from a different computer the device will rightfully complain that the app it has installed doesn't have the same certificate as the new version you are trying to install.

有两种可能的方案来解决这个 -

There are two potential solutions for this-


  • 只需卸载该应用程序,并尝试重新部署它。

  • Simply uninstall the app and try deploying it again.

将一个密钥库(例如一个调试密钥库)的源代码控制,并明确使用该密钥签署您建立调试通过的定义在摇篮签名配置。

Put a keystore (such as one of your debug keystores) in source control, and explicitly use that key to sign your debug builds by defining a signing configuration in Gradle.

请注意,在Windows上,调试密钥库通常位于 C:\\用户\\ [用户​​名] \\机器人\\ debug.keystore

Note that on windows, your debug keystore is typically located at C:\Users\[username]\.android\debug.keystore.

这篇关于两种不同的机器人工作室,但同一个项目中,他们是产生不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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