cordova-plugin-firebase cannot build for android error: com.google.android.gms:play-services-base

cordova-plugin-firebase cannot build for android error: com.google.android.gms:play-services-base

我已将 cordova-plugin-firebase 插件包含到我的项目中,但在 Android 上构建时遇到困难(ios 没问题)。

$ cordova 插件添加 cordova-plugin-firebase --save $ ionic cordova 平台添加 android 打开 android studio - 同步 gradle 然后出现以下错误

Error:Could not find play-services-base.jar (com.google.android.gms:play-services-base:15.0.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/google/android/gms/play-services-base/15.0.1/play-services-base-15.0.1.jar

仅供参考,这里有一些项目详细信息

Im using ionic version 1
"cordova-android": "~6.3.0",
in build.gradle: classpath 'com.android.tools.build:gradle:2.2.3'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // SUB-PROJECT DEPENDENCIES START
    debugCompile(project(path: "CordovaLib", configuration: "debug"))
    releaseCompile(project(path: "CordovaLib", configuration: "release"))
    compile "com.android.support:support-v4:24.1.1+"
    compile "com.google.gms:google-services:+"
    compile "com.google.android.gms:play-services-tagmanager:+"
    compile "com.google.firebase:firebase-core:+"
    compile "com.google.firebase:firebase-messaging:+"
    compile "com.google.firebase:firebase-crash:+"
    compile "com.google.firebase:firebase-config:+"
    compile "com.google.firebase:firebase-perf:+"
    compile "com.android.support:appcompat-v7:23+"
    compile "com.onesignal:OneSignal:3.9.1"
    // SUB-PROJECT DEPENDENCIES END
}

in the Android SDK Manager -> SDK Tools. Google Play Services version 49 is installed https://imgur.com/a/qR29lbL

这是我的 build.gradle 文件 gist.github.com/axilaris/39a22849a649c60bcce079b67d4bb638

我该如何解决 android 的问题?

可以在这里找到答案:

https://issuetracker.google.com/issues/80362794

修复方法是将 google url 放在 gradle 的存储库列表中的 jcenter() 上方。 这是问题所在:https://issuetracker.google.com/issues/80362794

基本上,下面是我在 build.gradle

中工作的修复
buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()

    }

    // Switch the Android Gradle plugin version requirement depending on the
    // installed version of Gradle. This dependency is documented at
    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
    // and https://issues.apache.org/jira/browse/CB-8143
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }
}

// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()

    }
}