Groupie库未安装

时间:2018-11-24 08:30:21

标签: android gradle

所以我试图将groupie libray添加到我的项目中,但我不断收到此错误:

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-33:19 to override.

我不知道要怎么做,我将其导入清单文件中是这样的

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.dbzfan200gmail.firebasemessenger"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.5'

    implementation 'de.hdodenhof:circleimageview:2.2.0'

    implementation 'com.xwray:groupie:2.3.0'

    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.android.support:recyclerview-v7:28.0.0'


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

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

我尝试过以下答案: https://github.com/material-components/material-components-android/issues/193

但是无济于事,现在我完全迷失了为什么它不起作用。

1 个答案:

答案 0 :(得分:0)

请尝试将其添加到您的build.gradle文件中。它对我有用。

实现'com.xwray:groupie:2.0.3'

实现'com.xwray:groupie-kotlin-android-extensions:2.0.3'