phani teja
phani teja

Reputation: 23

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-maps:11.8.0

I'm getting the below error:

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-maps:11.8.0

This error arises while creating a new map project in android studio.

My build.gradle:

apply plugin: 'com.android.application'android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.phaniteja.maps"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}      

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'  
}

Can any one help me?

Upvotes: 2

Views: 2113

Answers (1)

Bineesh P Babu
Bineesh P Babu

Reputation: 275

allprojects {
repositories {
    jcenter()
    maven { url "https://maven.google.com" }
}}

Add this in build.gradle. If you are using google_service.json ensure this apply plugin: 'com.google.gms.google-services' comes after your dependencies to avoid version issues. Add classpath too .classpath 'com.google.gms:google-services:3.2.0'

Upvotes: 1

Related Questions