Failed to resolve: `com.google.android.gms:play-services-appindexing:10.0.0`
Asked Answered
B

4

32

While setting compile 'com.google.android.gms:play-services-appindexing:10.0.0' it is giving following error:

Error:(82, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.0

and while setting compile 'com.google.android.gms:play-services-appindexing:9.8.0' it is giving following error:

Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.0.0.

It would be grateful if someone can tell me whats wrong with this because rest play services version 10.0.0 working fine.

my build.gradle file

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.22.0'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    signingConfigs {

    }
    compileSdkVersion 25
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 41
        versionName "2.2.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            signingConfig signingConfigs.config
        }
    }
    lintOptions {
        checkReleaseBuilds false
    }
}

configurations {
    compile.exclude group: 'stax'
    compile.exclude group: 'xpp3'
}

repositories {
    maven {
        url "http://dl.bintray.com/microsoftazuremobile/SDK"
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    //Microsoft azure
    compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'
    compile files('libs/notification-hubs-0.4.jar')

    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:palette-v7:25.0.1'

    compile 'com.google.android.gms:play-services-auth:10.0.0'
    compile 'com.google.android.gms:play-services-maps:10.0.0'
    compile 'com.google.android.gms:play-services-analytics:10.0.0'
    compile 'com.google.android.gms:play-services-gcm:10.0.0'
    compile 'com.google.android.gms:play-services-appindexing:10.0.0'
    compile 'com.google.android.gms:play-services-base:10.0.0'

    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.android.support:multidex:1.0.1'

    //Facebook SDK
    compile 'com.facebook.android:facebook-android-sdk:4.17.0'

}

apply plugin: 'com.google.gms.google-services'
Blackthorn answered 22/11, 2016 at 1:35 Comment(4)
That is weird.. :thinking:. Have you update your sdk?Secretion
Can you post your build.gradle in your quetion. This will be help to understanding your problemSquireen
Also check have you added in your gradle level classpath 'com.google.gms:google-services:3.0.0' or notSquireen
@NitinKarande Yes I have addedBlackthorn
B
27

Now Google Play Services Version 10.0.1 has released so replace this compile 'com.google.android.gms:play-services-appindexing:10.0.0'

by compile 'com.google.firebase:firebase-appindexing:10.0.1'

Blackthorn answered 29/11, 2016 at 13:5 Comment(0)
F
39

The appindexing library you are looking for is now under a new gradle target.

You want to add compile 'com.google.firebase:firebase-appindexing:10.0.0' to your app's build.gradle file :)

You can see the up-to-date libraries here.

Fluorocarbon answered 22/11, 2016 at 2:0 Comment(4)
This only working if op uses firebase. I stand corrected.Secretion
But if we check here developers.google.com/android/guides/setup , they have given support for com.google.android.gms:play-services-appindexing:10.0.0Blackthorn
Thanks for pointing that out. That page has been updated to show the name change. The previous API is still available at this new gradle target so should require no code changes, except changing the build target and adding Firebase to your project.Fluorocarbon
I think it would be best to comment the chosen answer adding the link to the updated play services rather than propose your own answer as independent because it still looks crude for some novices.Ritornello
B
27

Now Google Play Services Version 10.0.1 has released so replace this compile 'com.google.android.gms:play-services-appindexing:10.0.0'

by compile 'com.google.firebase:firebase-appindexing:10.0.1'

Blackthorn answered 29/11, 2016 at 13:5 Comment(0)
G
12

Hi, anytime you come across this type of error, the first thing to do is usually to check if you have the latest version of google repository installed in your Android Studio. I had the same issue and after updating as everything works fine. Hope it helps.

Gustave answered 22/11, 2016 at 9:14 Comment(2)
Exactly the issue I had :)Annulose
I just checked it out. It's updated but still having the same issueShivery
N
5

I had to do two things. Add:

compile 'com.google.firebase:firebase-appindexing:10.0.0'

which apparently is new. This API is now listed as a sole firebase API among all the Google Play services setup APIs here. Also REMOVE the play-services-appindexing compile this API replaces:

//no longer include 'play-services-appindexing' compile
//compile 'com.google.android.gms:play-services-appindexing:10.0.0

I had removed the play-services-ads compile when first installing firebase services months ago, as instructed by docs, although including it does not crash the project compile like including play-services-appindexing now does.

On uploading the release apk, I found three permissions unfortunately now added to my required permissions after upgrading my sdks and adding the firebase-appindexing compile. These were not in my manifest:

android.permission.READ_EXTERNAL_STORAGE,
android.permission.READ_PHONE_STATE, and
android.permission.WRITE_EXTERNAL_STORAGE

Edit 12/9/16: As commented by Gaurav, play-services version 10.0.1 has eliminated the added 'dangerous' permissions of READ_PHONE_STATE, READ_EXTERNAL_STORAGE, and WRITE_EXTERNAL_STORAGE, resulting I expect from a manifest merge in version 10.0.0. These permissions call a special dialogue box that can discourage your users from continuing with your app ('Is this game trying to take over my phone?'). If you use firebase compiles, be sure to upgrade all of those to 10.0.1 too. They won't be grayed out like the play-services compiles, an unfortunate inconsistency in the app gradle upgrade warnings. If you neglect to upgrade the firebase compiles to match the play-services compiles you get the infamous 'cannot access zzanb after using play-services' project compile crash - Firebase Error cannot access zzanb after using play-services-xxx:9.8.00.

Naze answered 22/11, 2016 at 16:45 Comment(3)
You are right, it is now `firebase-appindexing', I also had to change implementation code. Refer: github.com/googlecodelabs/app-indexingFelix
I had to change the implementation code as well. appearantly you now have to specify an indexing object and a action object. Very confusing. Specially because the indexing object needs to be added just once (I am suppose to keep track of added indexables??) and the action object every time a user does something. For some reason i won't get any results in the google search toolbar anymore.Barilla
I guess with 10.0.1 the issue of the new permissions being added is resolved. Let us know your experience.Gorilla

© 2022 - 2024 — McMap. All rights reserved.