将 com.google.android.gms:play-services 替换为 google-play-services.jar

replacing com.google.android.gms:play-services with google-play-services.jar

我正在使用 android studio 在 android 上构建一个 google 地图应用程序 当我发布我的应用程序的第一个版本时,没有人能够查看 google 地图,因为 google 播放服务必须由用户安装在设备上(我不能要求人们在每台设备上下载它) 所以我想将它嵌入到我的应用程序中。

我已经搜索了 4 天,到目前为止还没有成功

我知道 google-play-services.jar 库可以添加到应用程序中,这样用户就不需要安装播放服务了

我不确定是否应该在我的 android 工作室应用程序中使用 google-play-services.jar 或 com.google.android.gms:play-services。

我在其他答案中读到,我可以在我的应用程序中使用 google-play-services.jar,这样我就可以准备好 Google Play 服务,而无需用户安装它.

另一个人说 com.google.android.gms:play-services 是应用程序中必须的!

有这方面的经验吗? 请指教

谢谢

google-play-services.jar 只会与 smartphone 上安装的播放服务交互。你不能在你的apk中嵌入播放服务应用程序,这是没有意义的。

对于想要使用您的应用程序的人,他们需要通过 Play 商店下载,或者他们的 phone 上可能已经有 google 音乐或 google 地图,所以他们安装了播放服务。

所以只需在 gradle 文件中添加 google 播放服务 compile 'com.google.android.gms:play-services:(version)'