jsingh
jsingh

Reputation: 1346

Error: Failed to resolve: com.google.firebase:firebase-appindexing:9.6.1

This is Gradle app code and it show error
cannot compile
so my pull my hair not getting bug.
Please anybody ping here!!

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.3"

    defaultConfig {
        applicationId "com.google.firebase.codelab.friendlychat"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner          "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:24.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:appcompat-v7:24.2.1'

    // Google

    compile 'com.google.android.gms:play-services-auth:9.6.1'


    // Firebase

    compile 'com.google.firebase:firebase-database:9.6.1'
    compile 'com.google.firebase:firebase-auth:9.6.1'



    compile 'com.google.firebase:firebase-config:9.6.1'
    compile 'com.google.android.gms:play-services-appinvite:9.6.1'
    compile 'com.google.firebase:firebase-messaging:9.6.1'
    compile 'com.google.android.gms:play-services-ads:9.6.1'
    compile 'com.google.firebase:firebase-crash:9.6.1'

    This line getting error please anybody get in touch

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

}

apply plugin: 'com.google.gms.google-services'

Upvotes: 0

Views: 1578

Answers (3)

jsingh
jsingh

Reputation: 1346

Actually it was API error and bug also reported to google. so just error out.

Upvotes: 0

Sam Stern
Sam Stern

Reputation: 25134

If you are using Firebase version 9.8.0 or below you want to use the form com.google.android.gms:play-services-appindexing:<VERSION>. If you are using version 10.0.0 or above you want to use the form com.google.firebase:firebase-appindexing:<VERSION>. The name was changed in version 10.0.0.

If you are getting a "cannot resolve" error when trying this, update your Google Play Services SDK following this procedure: Failed to resolve: com.google.firebase:firebase-core:9.0.0

Upvotes: 2

Bob Snyder
Bob Snyder

Reputation: 38319

I haven't been able to find an explanation of the history of appindexing, but from looking at the revision history of the quickstart project, prior to 10.0.0, the package name was different. Try using this in your dependencies:

compile 'com.google.android.gms:play-services-appindexing:9.6.1'

This answer presumes you are using the features of the pre-10.0.0 API. The Migration Guide explains the differences.

Upvotes: 3

Related Questions