Error after updating android studio

0
  

Error: Could not find com.google.android.gms: play-services-cast: 9.6.1.   Required by:       android: app: unspecified Search in build.gradu files

How to resolve this error? Gradle already has this play-services.

Below is a gradle app:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'http://repo1.maven.org/maven2/' }
        maven { url 'https://clojars.org/repo' }
        jcenter()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.github.triplet.gradle:play-publisher:1.1.5'

    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'
apply plugin: 'com.github.triplet.play'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://clojars.org/repo' }
}


play {
    jsonFile = file('google-services.json')
}

ext {
    jacocoVersion = "0.7.5.201505241946"
}

configurations {
    all {
        resolutionStrategy {
            force "org.jacoco:org.jacoco.agent:$jacocoVersion"
        }
    }
}


android {
    testOptions {
        unitTests.returnDefaultValues = true
    }
    def versionPropsFile = file('version.properties')
    def code = 1;
    if (versionPropsFile.canRead()) {
        def Properties versionProps = new Properties()

        versionProps.load(new FileInputStream(versionPropsFile))
        List<String> runTasks = gradle.startParameter.getTaskNames();
        def value = 0
        for (String item : runTasks)
            if (item.contains("assembleRelease")) {
                value = 1;
            }
        code = Integer.parseInt(versionProps['VERSION_CODE']).intValue() + value
        versionProps['VERSION_CODE'] = code.toString()
        versionProps.store(versionPropsFile.newWriter(), null)
    } else {
        throw new GradleException("Could not read version.properties!")
    }

    signingConfigs {
        config {
            keyAlias 'publish'
            keyPassword 'Shoryuken21'
            storePassword 'Shoryuken21'
            storeFile file('../cer/android_studio_keystore.jks')
        }
    }
    compileSdkVersion 24
    buildToolsVersion "24.0.1"
    lintOptions {
        // but continue the build even when errors are found:
        abortOnError false
    }
    defaultConfig {
        applicationId "com.holandago.urbbox.app"
        minSdkVersion 18
        targetSdkVersion 22
        versionName "3.0." + code
        versionCode code
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            debuggable true
            testCoverageEnabled = true
        }
        release {
            debuggable false
            signingConfig signingConfigs.config
            ext.betaDistributionEmails = "[email protected]"
            ext.betaDistributionReleaseNotes = "Release Notes for this build."
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'LICENSE.txt'
/*        exclude 'META-INF/maven/com.google.guava/guava/pom.properties'
        exclude 'META-INF/maven/com.google.guava/guava/pom.xml'*/
    }
    productFlavors {
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.1@aar') {
        transitive = true
    }
    compile('com.mapbox.mapboxsdk:mapbox-android-services:1.1.0@aar') {
        transitive = true
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.5.6@aar') {
        transitive = true;
    }


    androidTestCompile "org.jacoco:org.jacoco.agent:$jacocoVersion"
    compile 'com.getkeepsafe.taptargetview:taptargetview:1.5.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.google.android.gms:play-services-cast:9.6.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.android.support:support-annotations:24.2.1'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'com.google.guava:guava:18.0'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.roughike:bottom-bar:1.2.1'
    compile 'com.koushikdutta.ion:ion:1.3.8'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
    compile 'com.pusher:pusher-java-client:0.3.3'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.mixpanel.android:mixpanel-android:4.6.4'
    compile 'com.jakewharton:butterknife:8.0.1'
    compile 'org.jetbrains:annotations-java5:15.0'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.github.clans:fab:1.6.4'
    testCompile 'junit:junit:4.12'
    testCompile 'org.robolectric:robolectric:3.0'
    testCompile 'org.mockito:mockito-all:1.10.19'
    androidTestCompile 'com.android.support:support-annotations:24.2.1'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
    apt 'com.jakewharton:butterknife-compiler:8.0.1'
}

gradle:

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

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

project.ext.preDexLibs = !project.hasProperty('disablePreDex')

subprojects {
    project.plugins.whenPluginAdded { plugin ->
        if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
            project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
        } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
            project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
        }
    }
}
    
asked by anonymous 31.01.2017 / 14:47

1 answer

1

I solved the question by adding this to the gradle app dependencies:

    classpath 'com.android.tools.build:gradle:2.2.0'
    classpath 'com.google.gms:google-services:3.0.0'

Clean Project - > Rebuild

So the gradient synchronized and the error did not happen anymore.

    
31.01.2017 / 16:47