-1

I am new in Android development, I am making Firebase chatting app, But suddenly I am facing the issue of transitive dependency. I followed this link Do not use + for a library version . But failed to resolve the problem. Here is my code build.gradle(Module),

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "kiran.example.com.firebasechattingapp21_11"
        minSdkVersion 18
        targetSdkVersion 26
        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(include: ['*.jar'], dir: 'libs')
    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:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-core:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.firebaseui:firebase-ui:1.1.1'
}


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

I am facing the following error,

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.0.0-alpha1, 25.1.0. Examples include com.android.support:animated-vector-drawable:26.0.0-alpha1 and com.android.support:cardview-v7:25.1.0

Following is the code of build.gradle (Project)

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

If anyone is having the solution please help.

Kiran S Kulkarni
  • 215
  • 1
  • 2
  • 16
  • compile 'com.android.support:animated-vector-drawable:26.0.0' compile 'com.android.support:cardview-v7:26.0.0' add these in gradle and it will fix this – Adeel Turk Nov 21 '17 at 06:49

5 Answers5

0

change this

 compile 'com.android.support:design:26.0.0-alpha1'

to

compile 'com.android.support:design:26.0.2-alpha1'

As stated these versions must be same to

buildToolsVersion "26.0.2"

Sara Tirmizi
  • 417
  • 4
  • 10
0

change below lines from app level gradle file.

compile 'com.android.support:appcompat-v7:26.+'

to

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
Flutterian
  • 1,761
  • 1
  • 21
  • 47
  • thanks for your help but getting an error Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute application@supportsRtl value=(true) from AndroidManifest.xml:10:9-35 is also present at [com.firebaseui:firebase-ui-auth:1.1.1] AndroidManifest.xml:14:18-45 value=(false). Suggestion: add 'tools:replace="android:supportsRtl"' to element at AndroidManifest.xml:5:5-19:19 to override. – Kiran S Kulkarni Nov 21 '17 at 06:48
  • can you please add `tools:replace="android.supportsRtl"` to your AndroidManifest.xml file inside application tag. Also add `xmlns:tools="http://schemas.android.com/tools"` to your manifest tag. Remove `tools:replace="android.supportRtl"` line from application tag. – Flutterian Nov 21 '17 at 06:51
  • adding and then again removing is giving the same error – Kiran S Kulkarni Nov 21 '17 at 07:14
  • it was my bad. I was about to say that remove `android:supportsRtl="true"` this line from application tag. add `tools:replace="android.supportsRtl"` line to application tag. – Flutterian Nov 21 '17 at 07:16
  • giving the manifest merging error Merging Errors: Error: tools:replace specified at line:6 for attribute tools:android.supportsRtl, but no new value specified app main manifest (this file), line 5 Error: Validation failed, exiting app main manifest (this file) – Kiran S Kulkarni Nov 21 '17 at 07:33
  • Can you please remove `tools:replace="android.supportsRtl"` and `android:supportsRtl="true"` lines and check once? – Flutterian Nov 21 '17 at 07:56
  • I solved this by adding xmlns:tools="http://schemas.android.com/tools" Add this to tools:node="replace" thanks for your help – Kiran S Kulkarni Nov 21 '17 at 08:00
  • It was mentioned in previous comments.. I thought you did still you are facing issues.. Now your issue resolved or not yet? – Flutterian Nov 21 '17 at 08:02
0

Add below code to build.gradle file

repositories {
    maven {
        url 'https://maven.google.com'
    }
}

and then change

compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:appcompat-v7:26.+'

to

compile 'com.android.support:design:26.0.2'
compile 'com.android.support:appcompat-v7:26.0.2'
DevB2F
  • 4,674
  • 4
  • 36
  • 60
Durga M
  • 534
  • 5
  • 17
  • thanks for the help but getting the same error with the message failed to resolve com.twitter.sdk.android 2.3.0 – Kiran S Kulkarni Nov 21 '17 at 06:44
  • solved com.twitter.sdk.android 2.3.0 related issue by this [link](https://stackoverflow.com/questions/41659272/errorfailed-to-resolve-com-twitter-sdk-androidtwitter2-3-0-android-studio) – Kiran S Kulkarni Nov 21 '17 at 07:47
0

This version should match with each other

FirebaseUI Version  Firebase/Play Services Version

    3.1.0   11.4.2
    3.0.0   11.4.2
    2.4.0   11.4.0
    2.3.0   11.0.4
    2.2.0   11.0.4
    2.1.1   11.0.2
    2.0.1   11.0.1
    1.2.0   10.2.0
    1.1.1   10.0.0 or 10.0.1
    1.0.1   10.0.0 or 10.0.1
    1.0.0   9.8.0

You versions are matching with each other i suggest you to upgrade versions like.

Firebase ui - 2.3.0  // firebase/play services -11.0.4
0

Yes after searching I Solved this issue by the following way

I added the following lines in build.gradle app level

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-core:10.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.firebaseui:firebase-ui:1.1.1'
    **//add the following for transitive dependency**
    compile 'com.android.support:animated-vector-drawable:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.android.support:customtabs:26.0.0-alpha1'
    compile 'com.android.support:palette-v7:26.0.0-alpha1'
}

after that I solved the problem which I have posted here, But one new problem occured i.e.

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@supportsRtl value=(true) from AndroidManifest.xml:12:9-35 is also present at [com.firebaseui:firebase-ui-auth:1.1.1] AndroidManifest.xml:14:18-45 value=(false). Suggestion: add 'tools:replace="android:supportsRtl"' to element at AndroidManifest.xml:7:5-22:19 to override.

By taking the reference from this I solved above new issue. Thanks for your comments. :-)

Kiran S Kulkarni
  • 215
  • 1
  • 2
  • 16