如何正确更新 Google Play 服务

How to properly update Google Play Services

是否可以在更改 build.gradle 中的 Google Play 服务库后更新我的应用程序?

我将其更改为:
compile 'com.google.android.gms:play-services:8.3.0'

compile 'com.google.android.gms:play-services-ads:8.4.0'

更改 Play 服务版本并在我的 phone 上安装后,android 工作室给了我一个警告,说我无法更新现有的应用程序,我必须卸载它。那么,我是否仍可以在开发者控制台中发布新的 APK,它会导致问题吗?

我怀疑这里发生的事情是您的签名密钥不匹配。 (即,如果您在 Android Studio 中使用调试密钥时从 Play 商店下载了 release-key 版本)更改 Play 服务应该不会产生这种影响。

如果您的应用程序是由您第一次为应用程序签名时使用的相同旧密钥签名的,则您只能将应用程序更新到 Play 商店。

您可能已经知道,当您在设备上将应用程序编译为 运行 进行测试时,它会使用调试密钥进行签名。

如果您已经在 phone 上安装了使用生产密钥签名的应用程序,而您尝试 re-install 使用调试密钥签名的应用程序,则它将无法运行。您首先必须卸载旧应用程序,然后重新安装。

总而言之,如果您使用您拥有的旧生产密钥签署您的应用程序,您只能发布新版本。在这种情况下,应用程序将在用户 phone 上更新,而无需他们卸载您的旧应用程序。

After changing the Play Service version, and installing on my phone, android studio gave me a warning saying that I can't update the existing application, and I must uninstall it.

它会向您发出警告,因为在您的设备中您已经签署了 APK,并且您正在尝试使用调试 apk 更新它。因此生成签名的 apk(无论您以前使用过什么,都使用相同的证书)然后更新设备中的应用程序。

So, can I still release the new APK in the developer console, and will it cause issues?

在上述过程中没有问题,然后您可以在 Google Play 商店

上传相同签名的 apk

assume you know what is signed & debug apk and how to generate both


已编辑:

Gradle 是构建系统。我无法用简单的方式解释它,但您可以在 this answer and for more about build system and Build System Overview

中阅读 Gradle 的更多详细信息