5

I get an error after adding 'com.firebaseui:firebase-ui-auth:1.0.0' to the dependency. The error goes away when I delete 'com.firebaseui:firebase-ui-auth:1.0.0' from the gradle. Code and pic included below Help please

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.example.a.chatapp"
    minSdkVersion 22
    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.0'



compile 'com.firebaseui:firebase-ui:0.3.1'






compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

enter image description here

kaka
  • 597
  • 3
  • 5
  • 16
  • Like the error says, try those other versions (eg. 24.2.1, and 23.4.0). If these don't work, take another screenshot of the last image without the error message popped up. Looks like the message is covering up some things that might be your problem. – Appafly Mar 22 '17 at 19:36
  • here i update with latest version code https://stackoverflow.com/a/48438621/2788786 – Muhammad Usman Ghani Jan 25 '18 at 08:34

5 Answers5

12

Here exist an error!

compile 'com.android.support:appcompat-v7:25.3.1'

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.3.1, 25.3.0. Examples include 'com.android.support:animated-vector-drawable:25.3.0' and 'com.android.support:mediarouter-v7:24.0.0'

Seeing this Examples include 'com.android.support:animated-vector-drawable:25.3.0' and 'com.android.support:mediarouter-v7:24.0.0'

Just add these codes in dependencies, make sure that versions are same.

Just update build.gradle file with this :-

compile 'com.android.support:animated-vector-drawable:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'
CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
GAGAN BHATIA
  • 591
  • 5
  • 17
5

The problem is that you use two (or more) different versions of the same dependency. The first one is specified in your gradle file and the other dependencies are used by library which you use (in this case firebase-ui probably).

You have more options here. At first you should try to update firebase-ui dependency. They usually keep their support dependecies updated so I guess that they use the same version of support libraries as you in their current master branch (I guess that you use the newest 'com.android.support:appcompat' version, right?). If the last version of firebase-auth doesn't use the current version of support libraries you can either downgrade your support libraries version so it will match their either you can create your own fork of firebase-auth and keep it updated on your own.

Tom Wayne
  • 1,288
  • 1
  • 12
  • 31
3

What you need to do is check the which library dependency version is conflicting you can track that library with Run androidDependancies like: AndroidDependacies Report
and then find that conflicting dependency and add those dependencies with updated versions in your gradle file.

Vijay Makwana
  • 506
  • 5
  • 14
  • 1
    This answer and https://stackoverflow.com/a/50010185/7323667 helped me to solve my problem, thank you. – yane Jun 01 '18 at 06:18
2

Add these lines of code in your build.gradle (Module:app) file at end:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '27.1.1'
            }
        }
    }
}

You must change useVersion from '25.3.1' to your current compile/implementation SDK version.

NOTE:

If you are still using compile in your build.gradle file then replace it with implementation or api because compile support will be ended officially at the end of 2018.

For more details you may refer:

Error: when I replace compile with implementation in gradle(dependency)

What's the difference between implementation and compile in gradle

Aashish Kumar
  • 2,771
  • 3
  • 28
  • 43
0

putting

//noinspection GradleCompatible

Solved my issue

novus 7
  • 1
  • 2
  • That doesn't solve the issue. It just hides the issue, that means IDE won't inspect those issues – Farid Jul 09 '19 at 16:59