簡體   English   中英

IONIC:安裝`cordova-plugin-fcm`后無法構建應用

[英]IONIC: unable to build app after installing `cordova-plugin-fcm`

我是ionic框架的ionicsidemenu 。目前我在ionicsidemenu android應用程序上工作。 我想在我的應用程序中為此通知我已經安裝了cordova-plugin-fcm插件。 安裝插件后,當我運行ionic run android它會生成帶有以下錯誤的構建失敗消息

建立錯誤

我已經在firebase console配置了我的應用程序。 我的應用程序中有插件:

插件清單

請幫我。

您的platform / android / project.properties應該這樣更改:

target=android-25

android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/courseur-xwalk.gradle
cordova.gradle.include.2=cordova-plugin-firebase/courseur-build.gradle
cordova.system.library.1=com.google.firebase:firebase-core:+
cordova.system.library.2=com.google.firebase:firebase-messaging:+
cordova.system.library.3=com.google.firebase:firebase-crash:+
cordova.system.library.4=com.google.firebase:firebase-config:+
cordova.system.library.5=com.google.firebase:firebase-core:9.0.0
cordova.system.library.6=com.google.firebase:firebase-messaging:9.0.0
cordova.system.library.7=com.android.support:support-v4:+
cordova.system.library.8=com.google.android.gms:play-services-analytics:+

確保您已安裝了Google Play服務SDK。

在我的MAC上,我使用Android Studio->配置(在底部)-> SDK Manager。

步驟1(對於FCM插件)在FCMPlugin.gradle文件中注釋掉這些行。

classpath 'com.google.gms:google-services:3.0.0'
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin

第2步(對於FCM插件)在我的情況下,將FCM插件的plugin.xml更改為使用其他版本9.8.0。

<framework src="com.google.firebase:firebase-core:9.8.0" />
<framework src="com.google.firebase:firebase-messaging:9.8.0" />

步驟3(對於Background-Geolocation-Plugin),將Geolocation插件的plugin.xml更改為使用其他版本,在我的情況下為9.8.0,而不是“ +”。

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

步驟4刪除並重新添加平台。

步驟5(android平台文件夾的build.gradle文件)將此行添加到classpath部分

classpath 'com.google.gms:google-services:3.1.0'

並將此行添加到依賴項下方,接近文件的底部

apply plugin: 'com.google.gms.google-services'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM