如何使Ionic的Firebase Cloud Messaging和Google Plus插件协同工作

时间:2018-06-29 02:47:31

标签: android ionic-framework cordova-plugins cordova-plugin-fcm

因此,我开始了一个新的Ionic项目,该项目使用Google Plus pluginFirebase Cloud Messaging for push notifications。将这些添加到我的项目后,我将无法成功构建apk。这是我收到的消息:

:compileDebugRenderscript
 UP-TO-DATE
:generateDebugBuildConfig
 UP-TO-DATE
:generateDebugResValues
 UP-TO-DATE
:processDebugGoogleServices
Found com.google.android.gms:play-services-auth:11.0.4, but version 9.0.0 is needed for the google-services plugin.
Found com.google.android.gms:play-services-identity:11.0.4, but version 9.0.0 is needed for the google-services plugin.
:processDebugGoogleServices 
FAILED

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.

* Try:

Run with 
--stacktrace
 option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.515 secs
Error: /home/ajabbar/projects/ionic/fcmTest/platforms/android/gradlew: Command failed with exit code 1 Error output:
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.

谷歌搜索此问题导致我to this Github issue。建议的“解决方案”对我不起作用。通过修改platforms目录下的文件,最终使项目得以构建,但通知无法正常工作。即使其中一种解决方案确实对我有用,但它们似乎都不安全。将依赖项的依赖项安装到项目中之后,修改它们的依赖项有些不对劲。

有没有人找到将Googe登录和推送通知添加到Ionic应用程序的好解决方案?此时,如果无法解决,我准备用其他方式重写它。这两个功能对于我的应用程序都是必不可少的。没有通知,它将毫无用处。而且我讨厌不得不编写自己的身份验证模块,因为我无法让这些插件协同工作。

任何帮助将不胜感激。

0 个答案:

没有答案