繁体   English   中英

Phonegap + Android + FCM和Health插件

[英]Phonegap + Android + FCM & Health plugins

当我安装cordova-plugin-health时,一切正常,但是在安装cordova-plugin-fcm之后,构建失败。 在下面登录。 自上周以来,我一直在苦苦挣扎,现在很难找到我从未见过的Stack Overflow答案。

BUILD FAILED

Total time: 2.923 secs

Error: /Users/[...]/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

要考虑的一些事情:

  • 确保在项目目录的根目录中有“ google-services.json”文件(对于cordova-plugin-fcm)
  • 尝试从SDK管理器更新Android SDK平台
  • 尝试从您的项目中删除android平台(“ phonegap平台删除android”),并使用“ phonegap平台添加android @ latest”添加最新版本的android

最后一点是为我解决了类似问题的那一点,因为较低版本的phonegap android使用最新的FCM / GCM库存在问题。

这是由Gradle配置中的版本冲突引起的。 cordova-plugin-fcm正在请求com.google.android.gms v9.0.0(播放服务库),但cordova-plugin-health正在请求最新版本,即。 +最新版本为v11.2.0。

如此cordova-plugin-fcm问题中概述的那样,没有一种适用于所有插件冲突的简单解决方案: cordova-plugin-fcm存在问题,因为版本是隐式指定的

您可以尝试的一种解决方案是安装cordova-android-play-services-gradle-release ,将PLAY_SERVICES_VERSION指定为PLAY_SERVICES_VERSION

cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=9.0.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM