Cordova / Ionic Android:Push和GoogleMaps插件之间的Google Play服务版本冲突

Nak*_*nch 2 android cordova firebase google-play-services ionic-framework

我目前正在开发一个需要PushGoogleMaps插件的Ionic应用程序。

如果我创建一个空白/新项目,添加android平台,并仅安装其中一个插件,则一切运行正常。但是,一旦安装了两个插件,便无法构建Android。

到目前为止,这是我所做的事情,并且是证明问题的最基本/最简单的方法:

  1. ionic start GoogleServicesIsues空白
  2. cd GoogleServicesIssue
  3. 离子科尔多瓦平台添加android @ latest
  4. 离子Cordova插件添加cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID =“ 123” --variable API_KEY_FOR_IOS =“ ABC”
  5. 离子Cordova插件添加phonegap-plugin-push --variable FCM_VERSION = 15.0.1
  6. 离子科尔多瓦建立Android

...并且构建失败,因为找不到Firebase消息库。

无法解析配置':app:debugCompileClasspath'的所有文件。

找不到com.google.firebase:firebase-messaging:15.0.1。在以下位置搜索:

文件:/ Users / [user] /Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-messaging/15.0.1/firebase-messaging-15.0.1.jar

https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.1/firebase-messaging-15.0.1.pom

 https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.1/firebase-messaging-15.0.1.jar
Run Code Online (Sandbox Code Playgroud)

https://maven.google.com/com/google/firebase/firebase-messaging/15.0.1/firebase-messaging-15.0.1.pom

有谁能弄清楚如何使这两个插件协同工作?

Mar*_*ler 5

这是来自Push插件,它在缺少依赖项build.gradle

api "com.google.firebase:firebase-messaging:17.3.2"
Run Code Online (Sandbox Code Playgroud)

^我有版本17.3.2-在您请求版本时15.0.1

...因此,我认为安装现有版本应该可以解决以下问题:

ionic cordova plugin rm phonegap-plugin-push
ionic cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.3.2
Run Code Online (Sandbox Code Playgroud)

该版本15.0.1可能更适合Google Play服务;一样添加:

<framework src="com.google.android.gms:play-services-base:15.0.1"/>
<framework src="com.google.android.gms:play-services-auth:16.0.0"/>
Run Code Online (Sandbox Code Playgroud)

如果仍然缺少其他依赖项,请在下面发表评论。