Дублирующиеся ресурсы при интеграции аварийного анализа Firebase и зависимостей Fabri c - PullRequest
1 голос
/ 03 мая 2020

У меня есть следующий файл gradle (: app) -

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.twoverte"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 8
        versionName "1.0.7"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        kotlinOptions {
            jvmTarget = JavaVersion.VERSION_1_8.toString()
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Room components
    implementation 'androidx.room:room-runtime:2.2.5'
    implementation 'androidx.room:room-ktx:2.2.5'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.4'
    kapt 'androidx.room:room-compiler:2.2.5'
    kapt "android.arch.persistence.room:compiler:2.2.5"

    //Lifecycle components
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'

    //Kotlin
    implementation 'org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.72'
    implementation "androidx.core:core-ktx:1.2.0"
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha02'

    //Google
    implementation 'com.google.android.gms:play-services-auth:18.0.0'
    implementation 'com.google.android.gms:play-services-auth-api-phone:17.4.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'

    //Networking
    implementation 'com.smartarmenia:dotnetcoresignalrclientjava:1.14'
    implementation 'com.microsoft.signalr:signalr:5.0.0-preview.2.20167.3'
    implementation 'com.squareup.retrofit2:retrofit:2.8.1'

    //RxJava + RxAndroid
    implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
    implementation 'io.reactivex.rxjava3:rxjava:3.0.0'

    //Gson
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.retrofit2:converter-gson:2.8.1'

    //Firebase
    implementation 'com.google.firebase:firebase-messaging:20.1.6'

    //Firebase Crashlytics
    implementation 'com.google.firebase:firebase-analytics:17.4.0'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
        transitive = true
    }

    //Permissions
    implementation 'com.karumi:dexter:6.1.0'

    //UI
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.android.support:multidex:1.0.3'
    implementation "androidx.viewpager2:viewpager2:1.0.0"
    implementation 'com.google.android.material:material:1.1.0'
    implementation "androidx.cardview:cardview:1.0.0"
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
    implementation "androidx.exifinterface:exifinterface:1.2.0"
    implementation 'id.zelory:compressor:3.0.0'
    implementation 'commons-io:commons-io:20030203.000550'
    implementation 'com.libRG:customtextview:2.2'

    //Compression
    implementation 'id.zelory:compressor:3.0.0'

    //Util
    implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:3.0.0-RC2'
}

и следующий файл gralde (: project) -

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

buildscript {
    ext.kotlin_version = '1.3.72'
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'

        //Firebase Crashlytics
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
        classpath 'io.fabric.tools:gradle:1.28.0'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }

    }
}

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

По какой-то причине он дает мне Duplicate resource ошибка -

enter image description here

Я попытался удалить файлы, которые были там упомянуты, но это не помогло, поскольку они были повторно добавлены, и появляется ошибка снова и снова.

Я не могу понять, где конфликт, но обе библиотеки, кажется, не счастливы вместе.

Пытался проверить решение здесь, но ничего не помогает.

Ответы [ 2 ]

1 голос
/ 03 мая 2020

FYI

Fabri c является устаревшим и будет доступно до 4 мая 2020 года для существующих пользователей. Crashlytics и Crashlytics Beta были интегрированы в Firebase , с новыми функциями Firebase.

Не

 classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
 classpath 'io.fabric.tools:gradle:1.28.0'

Do

// Add the Fabric Crashlytics plugin.
classpath 'io.fabric.tools:gradle:1.31.2'

В вашем уровень приложения build.gradle, добавить зависимости Crashlytics:

// (Recommended) Add the Google Analytics dependency.
implementation 'com.google.firebase:firebase-analytics:17.4.0'

// Add the Firebase Crashlytics dependency.
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

Прочитать официальное руководство о Get started with Firebase Crashlytics.

1 голос
/ 03 мая 2020

Возможно, я не прав, но мне кажется, проблема в том, что вы используете fabri c и firebase одновременно, а fabri c больше не поддерживается, насколько я знаю

" Будущее фабрики Мы интегрировали лучшее из Fabri c в Firebase, чтобы предоставить вам одну мощную платформу для разработки приложений. Fabri c устарела и будет доступна до 4 мая 2020 года для существующих пользователей. Новые пользователи должны начинать работу в Firebase воспользоваться новейшими продуктами и функциями, которые мы там создаем. Подробнее "

...