2017-09-25 217 views
0

错误:无法解析:com.google.android.gms:发挥服务地下室:[11.0.4]错误:无法解析:com.google.android.gms

错误:无法解析:com.google.android.gms:发挥服务任务:[11.0.4]

enter image description here

enter image description here

enter image description here

当我使用android studio 2.3.2版本时,我的项目构建成功,但更新到android工作室版本到2.3.3和更新谷歌播放服务我得到这个错误,请帮助。

还有就是我的文件夹中没有发挥服务地下室和玩游戏服务的任务文件夹

当我评论这个“编译“com.google.android.gms:发挥服务定位:11.0。 4' ”行我的项目编制的罚款,如果再我取消我的项目未编制

项目摇篮文件:

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 
} 

模块摇篮文件:

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' 

} 

enter image description here

+1

“安装库和同步工程”的尝试,也许 –

+0

我点击安装,但没有happended – Lingeshwaran

+1

去SDK管理器和手动安装 –

回答

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'  
     } 
    } 
}