将Firebase UI添加到我的依赖项后,android manifest merger失败

时间:2018-04-03 20:10:10

标签: android firebase firebaseui

我已经升级到android studio canary并试图将firebase UI添加到我的应用程序中但是收到以下错误:

$sql = "SELECT `lastPrice` FROM `$table` WHERE `symbol` = '$symbol' AND import_nr > $from_import_nr";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {

 while($row = mysqli_fetch_array($result,MYSQLI_NUM)) {    // 
 $lastPrice = $row[0];
 echo $lastPrice;
        }
}

/*
I get prices but not in correct format
I'm geting this 0.000356060.000355710.000356070.000356060.00035607
but I need something like this for trader_sma function
$price_for_sma = array (0.00035606, 0.00035571, 0.00035607, 0.00035606, 0.00035607);
*/

这似乎是一些依赖性问题,但还是无法解决。我的gradle文件如下

Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.1) from [com.android.support:customtabs:26.0.1] AndroidManifest.xml:25:13-35
    is also present at [com.android.support:design:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:23:9-25:38 to override.

我被建议为

获得相同的版本
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.rainbow.dili"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

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.google.firebase:firebase-database:12.0.1'
    compile 'com.google.firebase:firebase-storage:12.0.1'
    compile 'com.firebaseui:firebase-ui:2.3.0'
    compile 'com.tbuonomo.andrui:viewpagerdotsindicator:1.0.1'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support.constraint:constraint-layout:1.1.0-beta6'
    compile 'com.droidninja:filepicker:2.0.7'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'jp.wasabeef:picasso-transformations:2.1.0'
    compile 'com.android.support:support-vector-drawable:26.1.0'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

compileSdkVersion 26

但仍然得到同样的错误。可能导致这种情况的原因是什么?

1 个答案:

答案 0 :(得分:1)

您使用的旧版firebaseui与firebase版本12.0.1不兼容,以解决此问题:

更改以下内容:

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

到此:

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

更多信息:

https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries