Cordova 添加 google 播放服务

Cordova add google play services

我刚刚将 OneSignal 添加到我的 Cordova 项目中。这似乎使用 Google Play 服务,即(我收到一条消息 "No valid Google Play services APK found")。我想知道添加它的最佳方法。

这将创建一个 google_play_services 文件夹(里面没有很多东西):

更新 根据 Google 已将 Google Play 服务分解为多个库 (.aar),位于:

android-sdk\extras\google\m2repository\com\google\android\gms

我有点不确定下一步该做什么。我以为我可以使用 this.

我可能会补充说我正在使用 IntelliJ 并尝试按照 this.

手动导入 JAR

谢谢,

您需要将其添加到您的项目库中..

File >> Import, select Android > Existing Android Code into Workspace,浏览到库项目(你的 android sdk env)导入它。 extras/google/google_play_services/

在此之后..您需要打开项目的属性.. 右键单击您的项目并单击属性 select android 并在库部分下添加 google lib.

OneSignal 错误 "No valid Google Play services APK found" 意味着 "Google Play services" 应用程序从设备中丢失或者很可能只是过时了。它应该检查设置>应用程序下的版本。在设备上打开 Google Play 商店并登录后,它应该会在后台自动更新。有关详细信息,请参阅以下 link。 https://documentation.onesignal.com/docs/all-users-are-shown-as-not-subscribed