0

错误:无法解决:com.google.android.gms:play-services-basement:[11.0.4]

错误:无法解决:com.google.android.gms:play-services-tasks:[11.0.4]

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

当我使用 android studio 2.3.2 版本时,我的项目构建成功,但是在将 android studio 版本更新到 2.3.3 并更新了 google play 服务后,我收到了这个错误,请帮忙。

我的文件夹中没有 play-services-basement 和 play-services-tasks 文件夹

当我评论这个“编译'com.google.android.gms:play-services-location:11.0.4'”行我的项目编译正常如果我取消注释然后我的项目没有编译

项目 Gradle 文件:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    buildDir = "C:/tmp/${rootProject.name}/${project.name}"
    repositories {
        jcenter()
    }
}

ext {

    compileSdkVersion = 25
    buildToolsVersion = "25.0.2"
    supportLibVersion = "25.3.1"
    minSdkVersion = 14
    targetSdkVersion = 25
}

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

模块 Gradle 文件:

apply plugin: 'com.android.application'

android {

    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "package"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
        debug {
            debuggable true
        }
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

}


repositories {
    jcenter {
        url "http://jcenter.bintray.com/"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
    compile 'com.google.android.gms:play-services-location:11.0.4'

    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.github.beyka:androidtiffbitmapfactory:0.9.6.2'

    debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'

}

在此处输入图像描述

4

1 回答 1

1

项目gradle文件:

buildscript {
    repositories {
        jcenter() 
        maven {
         url 'https://maven.google.com'    
       }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

allprojects {
    buildDir = "C:/tmp/${rootProject.name}/${project.name}"
    repositories {
        jcenter()
        maven {
          url 'https://maven.google.com'    
       }
  }
}
于 2017-09-27T11:23:37.580 回答