user7756468
user7756468

Reputation:

Failed to resolve: play-services-base

The error is not allowing gradle build to be successful.

My project level is below:

buildscript {
    repositories {
        jcenter()

        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1' 
        classpath 'io.fabric.tools:gradle:1.24.4'

    }
}

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

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

My app level gradle file dependencies dependencies

{
    implementation 'com.android.support:support-v4:28.0.0-alpha3'
    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'
    })
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.android.support:design:28.0.0-alpha3'
    testCompile 'junit:junit:4.12'
    implementation 'com.startapp:inapp-sdk:3.8.1'
    implementation 'com.android.support:gridlayout-v7:28.0.0-alpha3'
    implementation 'com.android.support:support-v4:28.0.0-alpha3'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

My Google Repository version is 58, Android Support Repository is 47.0.0, Android SDK Build Tools is 28.0.0

Upvotes: 0

Views: 755

Answers (2)

Samarakande
Samarakande

Reputation: 193

Take care of order where you put google()

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

Upvotes: 0

Saeed
Saeed

Reputation: 572

If you are using windows just delete .gradle folder in C:\users\"username"

I don't ever had android studio in Linux or Mac, but it must be: ~/.gradle

My issue solved this way.

Upvotes: 2

Related Questions