Cordova FCM - 构建错误:无法应用插件[id'com.google.gms.google-services']

iqu*_*rio 4 android ios cordova firebase firebase-notifications

我有一个Android和iOS的Cordova应用程序,我正在尝试添加FCM,以便我可以发送推送通知.我已经多次按照网站上的设置说明继续获得相同的构建错误.

这是我运行Cordova构建时遇到的错误

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Me\workspace\App\platforms\android\build.gradle' line: 326

* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.google.gms.google-services']
   > For input string: "+"
Run Code Online (Sandbox Code Playgroud)

这是build.gradle文件的最后一行apply plugin: 'com.google.gms.google-services',这是安装说明所要做的.

我已经创建了一个帐户,从中获取了我的包名AndroidManifest.xml,然后将其添加google-services.json到Android项目的main中,然后在build.gradle文件中添加了3行,但我仍然收到此错误.

我究竟做错了什么?谢谢您的帮助.

Cap*_*der 7

我有类似的问题.

我的修复是编辑./platforms/android/project.properties

我在所有谷歌服务上将+更改为10.0.1.(确保SDK是最新的)

即:

cordova.system.library.1=com.google.android.gms:play-services-analytics:+
Run Code Online (Sandbox Code Playgroud)

cordova.system.library.1=com.google.android.gms:play-services-analytics:10.0.1
Run Code Online (Sandbox Code Playgroud)

做一个构建,所有工作.