1

Good day, i want to use Firebase auth in my Android App. This is my project level gradle file

    buildscript {
    repositories {
    jcenter()
}
    dependencies {

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

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

    allprojects {
    repositories {
    jcenter()
}
}

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

This is my apps level gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "ibm.examplefirebase1"
        minSdkVersion 15
        targetSdkVersion 25
        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'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.google.firebase:firebase-database:10.0.1'

    compile 'com.google.firebase:firebase-appindexing:10.0.1'
    compile 'com.google.android.gms:play-services-appindexing:10.0.1'
}

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

The failure shown up as

while i had download the latest android repository version

I tried with latest support repository but it still wont work.

"Error:(32, 13) Failed to resolve: com.google.android.gms:play-services-appindexing:10.0.1"
AL.
  • 36,815
  • 10
  • 142
  • 281
ShunJian
  • 189
  • 1
  • 1
  • 7

3 Answers3

0

Replace

com.google.android.gms:play-services-appindexing:10.0.1

With

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

Follow this link: https://firebase.google.com/docs/android/setup#available_libraries

Satan Pandeya
  • 3,747
  • 4
  • 27
  • 53
Mrinmoy
  • 1,370
  • 2
  • 18
  • 28
0

You get this error because there is no such module like com.google.android.gms:play-services-appindexing:10.0.1

The modules available in com.google.android.gms are:

  • com.google.android.gms:play-services:10.0.1
  • com.google.android.gms:play-services-ads:10.0.1
  • com.google.android.gms:play-services-wearable:10.0.1
  • com.google.android.gms:play-services-maps:10.0.1

I think what you need to include is this: com.google.android.gms:play-services:10.0.1

Eric B.
  • 4,622
  • 2
  • 18
  • 33
0
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-database:10.0.1'

compile 'com.google.firebase:firebase-appindexing:10.0.1'
 // compile 'com.google.android.gms:play-services-appindexing:10.0.1'
}

for more details check my answer here

Community
  • 1
  • 1
Rushi Ayyappa
  • 2,708
  • 2
  • 16
  • 32