1

I have written an Android App that uses the Firebase database feature. Everything is working fine and now I would like to integrate the Authentication feature. So I modified my build.gradle for the app to include the two dependencies for the authentication:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.example.gmeunier.gestiondepoints"
        minSdkVersion 23
        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.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.google.android.gms:play-services-plus:10.2.6'
    compile 'com.google.firebase:firebase-database:10.2.6'

    compile 'com.firebaseui:firebase-ui-auth:1.2.0'
    compile 'com.google.firebase:firebase-auth:10.2.6'

    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

Despite all my efforts and research on this topic, I still have the following error when I try to sync this gradle :

Failed to resolve: com.twitter.sdk.android:twitter:2.3.0

I can't find which lib/component versions I must use and I would appreciate help and support.

KENdi
  • 7,576
  • 2
  • 16
  • 31
R42136
  • 33
  • 5

2 Answers2

0

Your project's gradle file should look like this.

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()

        // Required for 'com.firebaseui:firebase-ui:1.1.1'
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
}

Original answer: https://stackoverflow.com/a/41664069/7339411

Curio
  • 1,331
  • 2
  • 14
  • 34
  • it works! thanks a lot. I don't really understand why I now need this maven stuff and not before (ie when only the database feature was used in my app) – R42136 Jun 12 '17 at 14:20
0

Add the following line inside "repositories", inside "allprojects" and "buildscript" to your Project Level build.gradle file:

maven {
    url 'https://maven.fabric.io/public'
}
Kanaiya Katarmal
  • 5,974
  • 4
  • 30
  • 56