Cordova 将com.google.android.gms版本更新为9.2.0

Cordova 将com.google.android.gms版本更新为9.2.0,cordova,ionic2,firebase-cloud-messaging,Cordova,Ionic2,Firebase Cloud Messaging,我用的是离子2 我一直在使用谷歌FCM服务进行推送通知。今天我的电脑死机了,我不得不重新安装phonegap插件推送插件。现在在构建时,我得到以下错误: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':processDebugGoogleServices'. > Please fix the version conflict either by updating

我用的是离子2

我一直在使用谷歌FCM服务进行推送通知。今天我的电脑死机了,我不得不重新安装
phonegap插件推送
插件。现在在构建时,我得到以下错误:

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.2.0.

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

Error: cmd: 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.2.0.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
看起来一定有什么东西更新了,我想在需要更新依赖项的
phonegap plugin push
插件中(即
com.google.android.gms到9.2.0

有人知道我如何在Angular/Ionic/Cordova/npm环境中更新这个吗

更多信息:


您好,您可以尝试解决此问题,购买需要版本(即com.google.android.gms至9.2.0)的插件下载到您的机器上,在您的情况下,这将是最新版本。打开插件的plugin.xml文件,在android框架部分,更改部分

<framework src="com.google.android.gms:play-services:9.2.0" />


保存您的工作,从您的项目中删除插件,然后再次添加插件。这次从您的定位机而不是git存储库添加插件。(cordova plugin add my/local/folder)。我遇到了同样的挑战,但与cordova plugin fcm一起使用,所做的更改帮助我解决了问题,

当我收到相同的错误消息时,我在错误消息的末尾也看到了以下内容:

Found com.google.android.gms:play-services-auth:+, but version 9.2.0 is needed for the google-services plugin.
Found com.google.android.gms:play-services-identity:+, but version 9.2.0 is needed for the google-services plugin.
我通过更改文件
platforms/android/project.properties
内容解决了这些问题

cordova.system.library.1=com.google.android.gms:play-services-auth:+
cordova.system.library.2=com.google.android.gms:play-services-identity:+


检查您是否也看到有关上述特定
gms
服务的错误,然后进行相应的更改得到相同的问题,我的解决方案是卸载phonegap插件推送并删除android平台,然后再次添加android平台并安装phonegap插件推送,请参见下文:

我的行动:

ionic cordova plugin remove phonegap-plugin-push
ionic cordova platform remove android
ionic cordova plugin add phonegap-plugin-push
ionic cordova build android
ionic cordova run android

…而且有效!;)

这不是一个可持续的解决方案,如果您最终删除并重新添加平台,则必须再次手动执行。如果其他团队成员初始化项目,则相同。
cordova.system.library.1=com.google.android.gms:play-services-auth:9.2.0
cordova.system.library.2=com.google.android.gms:play-services-identity:9.2.0
ionic cordova plugin remove phonegap-plugin-push
ionic cordova platform remove android
ionic cordova plugin add phonegap-plugin-push
ionic cordova build android
ionic cordova run android