[英]“App not installed” when trying to install over existing debug apk
When two or more developers work in a team, they can't overwrite the installed APK if it is generated by the other developers.当两个或多个开发者在一个团队中工作时,如果它是由其他开发者生成的,他们不能覆盖已安装的 APK。 This is the exact scenario:这是确切的场景:
Can anyone tell why this error occurs is there any laptop level dependency is there?谁能告诉为什么会发生此错误是否存在任何笔记本电脑级别的依赖性?
This happens because the app you are building on Android is being signed with a specific keystore that is generated on your local machine.发生这种情况是因为您在 Android 上构建的应用程序正在使用本地计算机上生成的特定密钥库进行签名。 So when developer 1 signs the app with his keystore, it gets his fingerprint and you can install it fine.因此,当开发人员 1 使用他的密钥库对应用程序进行签名时,它会获取他的指纹并且您可以正常安装它。 But when developer 2 builds the app with his (different) keystore, it gets a different fingerprint.但是当开发人员 2 使用他的(不同的)密钥库构建应用程序时,它会获得不同的指纹。 Therefore Android won't let you overwrite the app that was already installed.因此 Android 不会让您覆盖已安装的应用程序。 The solution would be to share the debug keystore so the fingerprints of all APK's will align.解决方案是共享调试密钥库,以便所有 APK 的指纹对齐。
The keystore can be found in ~/.android/debug.keystore
.密钥库可以在~/.android/debug.keystore
中找到。
You can verify the fingerprint of your APK's with the following command: keytool -printcert -jarfile app.apk
, or keytool -printcert -jarfile app.aab
in case you output an aab.您可以使用以下命令验证 APK 的指纹: keytool -printcert -jarfile app.apk
或keytool -printcert -jarfile app.aab
如果您是 output 是 aab。
Before generating debug APK, Android Studio automatically signs your app with a debug certificate generated by the Android SDK tools.在生成调试 APK 之前,Android Studio 会自动使用由 Android SDK 工具生成的调试证书对您的应用进行签名。 So both the APKs are signed with different keys.因此,这两个 APK 都使用不同的密钥签名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.