shea1602
shea1602

Reputation: 1

Failed to resolve: com.google.android.gms:play-services

Following error messages are shown in the console. Failed to resolve: com.google.android.gms:play-services:15.0.1 Install Repository and sync project Show in File Show in Project Structure dialog

Also if i try to install the repository I am facing the following issue: Could not find dependency "com.google.android.gms:play-services:15.0.1

Gradle file is as follows:

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "fsit.luvder"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {

        // Enabling multidex support.
        multiDexEnabled true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'

        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }


    sonarqube {
        properties {
            property "sonar.projectName", "Kairos"
            property "sonar.projectKey", "Luvder"
            property "sonar.sources","src/main/java"
            property "sonar.language","java"
            property "sonar.sourceEncoding", "UTF-8"
        }
    }


}

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.google.firebase:firebase-perf:16.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':drawer')
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services:15.0.1'
    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.joooonho:selectableroundedimageview:1.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.roughike:bottom-bar:1.2.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-ima:+'
    // Only required if using IMA features
    implementation 'com.longtailvideo.jwplayer:jwplayer-chromecast:+'
    // Only required if using Chromecast
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.android.gms:play-services:15.0.'
    implementation 'com.github.ozodrukh:CircularReveal:1.0.4'
    implementation 'me.relex:circleindicator:1.2.2@aar'
}







configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}

apply plugin: 'jacoco'
jacoco {
    version "0.7.1.201405082137"
}


jacoco {
    toolVersion "0.7.1.201405082137"
}

def coverageSourceDirs = [
        'src/main/java',
]

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ])
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/jacoco/testDebug.exec")
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    }
}
apply plugin: 'com.google.gms.google-services'

EDIT: I have a new issue that is as follows: The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

UPDATE: Still facing the same issue as mention in the edit,even after following the responses.Thanks in advance.Seeking your expertise.

Currently my app gradle file is as follows:

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'


android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "fsit.luvder"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {

        // Enabling multidex support.
        multiDexEnabled true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'

        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }


    sonarqube {
        properties {
            property "sonar.projectName", "Kairos"
            property "sonar.projectKey", "Luvder"
            property "sonar.sources","src/main/java"
            property "sonar.language","java"
            property "sonar.sourceEncoding", "UTF-8"
foo/Foo.java"
        }
    }



}

dependencies {
    implementation 'com.google.firebase:firebase-messaging:16.0.1'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.google.firebase:firebase-perf:16.0.1'
    implementation "com.google.firebase:firebase-auth:16.0.1"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':drawer')
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'

    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.joooonho:selectableroundedimageview:1.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.roughike:bottom-bar:1.2.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-ima:+'
    // Only required if using IMA features
    implementation 'com.longtailvideo.jwplayer:jwplayer-chromecast:+'
    // Only required if using Chromecast
    testImplementation 'junit:junit:4.12'
    //implementation 'com.google.android.gms:play-services:16.0.1'
    implementation 'com.github.ozodrukh:CircularReveal:1.0.4'
    implementation 'me.relex:circleindicator:1.2.2@aar'
}






configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}


apply plugin: 'jacoco'

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true


jacoco {
    version "0.7.1.201405082137"
}


jacoco {
    toolVersion "0.7.1.201405082137"
}

def coverageSourceDirs = [
        'src/main/java',
]

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ])
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/jacoco/testDebug.exec")
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    }
}
apply plugin: 'com.google.gms.google-services'

And my project gradle is as follows:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()

        mavenCentral()
        maven { url "https://jitpack.io"

        }
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

        maven {
            url "https://plugins.gradle.org/m2/"
        }

        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

def isReleaseBuild() {
    return version.contains("SNAPSHOT") == false
}


allprojects {
    repositories {
        google()

        maven { url "https://jitpack.io" }
        maven {
            url 'https://mvn.jwplayer.com/content/repositories/releases/'
        }
        maven {
            url 'https://maven.google.com/'
        }
        jcenter()

    }
}

ext {
    sdk = 25
    buildTools = "24.0.2"
    minSdk = 14
    libraryVersion = "1.0.4"
    supportVersion = "25.0.0"
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
task wrapper(type: Wrapper) {
    gradleVersion = '2.13'
    distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
apply plugin: 'android-reporting'

Upvotes: 0

Views: 4991

Answers (2)

Jins Lukose
Jins Lukose

Reputation: 707

Upvotes: 0

I can see there is no version as 15.0.1 released.

please have a look at the release notes here

https://developers.google.com/android/guides/releases

Upvotes: 1

Related Questions