【问题标题】:"Could not find any version that matches com.google.android.gms:play-services-basement:[15.0.1,16.0.0)"“找不到任何与 com.google.android.gms:play-services-basement:[15.0.1,16.0.0) 匹配的版本”
【发布时间】:2018-06-14 20:49:50
【问题描述】:

我的项目运行正常,但今天,当我尝试重建它时,开始显示上述错误。我检查了类似问题的先前答案,但无法解决问题。这是 build.gradle(Module: app) 文件。

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
    compileSdkVersion 25
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "soumyadeb.com.mywatercan"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    implementation 'com.android.support:appcompat-v7:25.0.0'
    implementation 'com.android.support:design:25.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation "com.google.android.gms:play-services-places:15.0.1"
    implementation "com.google.android.gms:play-services-location:15.0.1"
    implementation "com.google.android.gms:play-services-auth:15.0.1"
    implementation "com.google.android.gms:play-services-base:15.0.1"

    testCompile 'junit:junit:4.12'
} 

下面是我的 build.gradle(Project: ..)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我收到此错误。

【问题讨论】:

    标签: android google-maps android-studio-3.1 android-googleapiclient


    【解决方案1】:

    在你的 build.gradle 中添加 google()

    allprojects {
        repositories {
            jcenter()
            google()
        }
    

    【讨论】:

      【解决方案2】:

      尝试implementation 'com.google.android.gms:play-services-vision:15.0.1' 获取所有播放服务 而且我认为我们在 Project build.gradle 中不需要 classpath 'com.google.gms:google-services:3.2.0'

      【讨论】:

        猜你喜欢
        • 2016-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-09-07
        • 2014-12-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多