Cordova 插件 Firebase 不适用于 Ionic 3 运行 android [英] Cordova Plugin Firebase not working with Ionic 3 run android
问题描述
我正在使用插件 cordova-plugin-firebase
做一个测试应用程序来执行推送通知,遵循本教程:https://angularfirebase.com/lessons/ionic-native-with-firebase-fcm-push-notifications-ios-安卓/ .当我尝试使用以下命令使用 android 编译项目时出现问题:ionic cordova run android
给我一个构建失败,错误如下:Could not find support-v4.aar (com.android.support:support-v4:26.1.0)
.你们对这个错误有什么想法吗?谢谢你.
I am doing a test app using the plugin cordova-plugin-firebase
to do Push Notifications, following this tutorial: https://angularfirebase.com/lessons/ionic-native-with-firebase-fcm-push-notifications-ios-android/ . The problem appears when I try to compile the project with android with the following command: ionic cordova run android
giving me a build failed where the error is the follows: Could not find support-v4.aar (com.android.support:support-v4:26.1.0)
. Do you guys have some idea about this error? Thank you.
推荐答案
你需要在platforms/android里面的build.gradle文件中做一些改动,并且需要添加maven { url 'https://maven.google.com' } 在 jcenter() 之前如下:
You need to do some changes in your build.gradle file inside platforms/android and need to add maven { url 'https://maven.google.com' } before the jcenter() as follows:
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' } //add this code
jcenter()
}
}
这篇关于Cordova 插件 Firebase 不适用于 Ionic 3 运行 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!