【问题标题】:Error(28, 13):Failed to resolve: com.google.android.gms:play-services:10.0.1错误(28、13):无法解决:com.google.android.gms:play-services:10.0.1
【发布时间】:2017-05-10 05:27:27
【问题描述】:

我想使用 Google 地图。 我的问题:

android-Studio 2.2,android-SDK 4.4,gradle:2.2.2,我的操作系统:win-10

    apply plugin: 'com.android.application'
android {
        compileSdkVersion 'Google Inc.:Google APIs:21'
        buildToolsVersion "23.0.3"
        defaultConfig {
            applicationId "ir.amir.map"
            minSdkVersion 19
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:23.3.0'
        testCompile 'junit:junit:4.12'
        compile 'com.google.android.gms:play-services:10.0.1'
    }

图片:

【问题讨论】:

    标签: android google-maps android-studio google-api


    【解决方案1】:

    点击错误中的Install Repository and sync project 选项。 SDK 管理器将安装缺少的存储库。

    【讨论】:

    【解决方案2】:

    检查您是否已将存储库添加到存储在根文件夹中的 build.gradle 文件中。

    尝试同时添加mavenCentral()jcenter()

    例如:

    build.gradle

    // ...
    buildscript {
        repositories {
            mavenCentral()
        }
    }
    // ...
    

    您还可以简化以下内容:

    compileSdkVersion 'Google Inc.:Google APIs:21'
    

    compileSdkVersion 21
    

    【讨论】:

    • @AmirKhoshnoud 你能把你的项目(或只是示例)发布到 GitHub 吗?
    • 没有。我看到了谷歌地图教育
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-15
    • 2018-11-23
    • 1970-01-01
    • 2018-03-27
    • 1970-01-01
    • 2016-07-16
    相关资源
    最近更新 更多