问题
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.
回答1:
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()
}
}
来源:https://stackoverflow.com/questions/51196432/cordova-plugin-firebase-not-working-with-ionic-3-run-android