-1

IMPORTANT NOTE:
I read this All com.android.support libraries must use the exact same version specification but none of those answers solved my problem. Same with Android Build execution failed due to incompatible library versions.

I want to connect my app to firebase realtime database and add an authentication with phone number and email. When I added the build.gradle dependencies in my app module for the realtime database there were no issues, but when I add the authentication dependencies i get the following message: error_message_screenshot The problem is that I already added those libraries in the same version (i put them all in 15.0.0), and yet even after sync i get the same message. What can I do to solve that problem ? Here is my gradle: (the commented part is another method found on firebase that i tried but it didn't work either)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "finalproject.mad.com.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:design:27.1.1'

    implementation 'com.google.firebase:firebase-iid:15.0.0'
    implementation 'com.google.android.gms:play-services-measurement-base:15.0.0'
    implementation 'com.google.firebase:firebase-database:15.0.0'
    implementation 'com.google.firebase:firebase-auth:15.0.0'

    /*implementation "com.google.firebase:firebase-auth:15.0.0"
    implementation "com.google.android.gms:play-services-auth:15.0.0"


    implementation "com.android.support:design:27.1.1"
    implementation "com.android.support:customtabs:27.1.1"
    implementation "com.android.support:cardview-v7:27.1.1"

    implementation "com.google.firebase:firebase-database:15.0.0"

    implementation "com.android.support:recyclerview-v7:27.1.1"
    implementation "com.android.support:support-v4:27.1.1"*/

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'

EDIT: Updating Android Studio fixed my problem

Anne
  • 41
  • 6
  • make sure you're using the latest version of Android Studio (`Android Studio -> Check for updates..`) – LS_ May 11 '18 at 09:53
  • @AnuraagBaishya i read what you wrote but here it was not an exception so there were no details, it was just a message. But next time i'll write it down in addition to the picture (here i was afraid it would make the post too long). Thanks for the feedback – Anne May 12 '18 at 05:35
  • 1
    @Signo updating Android Studio work, i was using version 3.0.1 and now it works with the new version. Thanks a lot ! – Anne May 12 '18 at 06:00
  • No problem! Glad I could help :) – LS_ May 12 '18 at 10:36

1 Answers1

1

Firebase updated the dependencies versions, use the following:

 implementation 'com.google.firebase:firebase-database:15.0.0'
 implementation 'com.google.firebase:firebase-auth:15.1.0'

more info here:

https://firebase.google.com/support/release-notes/android#latest_sdk_versions

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
  • Thanks a lot for your answer, but when i use this i still get the same problem, as i'm using different versions. Do i just ignore the issue ? – Anne May 11 '18 at 08:10
  • if i add implementation 'com.google.android.gms:play-services-*:3.3.0' before the 2 lines you wrote, I get the error "All firebase libraries must be either above or under 14.0.0". Yet i'm using versions 15.0.0 and 15.1.0 ... – Anne May 11 '18 at 08:20
  • add it in the top level gradle file – Peter Haddad May 11 '18 at 08:20
  • i did that and now i'm back to the first error i had ("All gms/firebase libraries lust be the exact same version specification") – Anne May 11 '18 at 08:26