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

只愿长相守 提交于 2019-12-11 14:55:18

问题


This was working before I added firebaseui dependency. Now I'm getting this: log

Its red lining compile 'com.android.support:appcompat-v7:26.+' and when I hover over it, it says "all libraries must be exact same specification version". That version was what was there when the project was created.

app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.android.adarak"
        minSdkVersion 21
        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(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:26.+'
    compile 'com.android.support:support-v4:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    //compile 'com.firebaseui:firebase-ui-auth:2.3.0'
    compile 'com.firebaseui:firebase-ui:2.3.0'
    testCompile 'junit:junit:4.12'
}


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

回答1:


The firebaseui internally has a dependency on a specific version of Android support library. The firebase ui configuration contains 26.0.1 as the required support library version.

However your gradle file has a dependency on 26.+ which tells gradle to use the latest in the 26.x.x series and this could be different from 26.0.1. You can solve the issue by using the specific version required by firebase-ui (26.0.1)

Change the gradle file as shown below,

compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'


来源:https://stackoverflow.com/questions/46312558/android-dependency-error-compile-com-android-supportappcompat-v726

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!