[英]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.
要考虑的一些事情:
最后一点是为我解决了类似问题的那一点,因为较低版本的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.