Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding dependency in gradle #16

Open
rafagan opened this issue Dec 18, 2018 · 5 comments
Open

Error adding dependency in gradle #16

rafagan opened this issue Dec 18, 2018 · 5 comments

Comments

@rafagan
Copy link

rafagan commented Dec 18, 2018

I experiencing the following error:

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 element at AndroidManifest.xml:9:5-97:19 to override.

My gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.10'

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    // Testes
    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'

    // Retrofit
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.google.code.gson:gson:2.8.4'
    implementation 'com.github.mrmike:Ok2Curl:0.4.5'

    // Fabric
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }

    // Architecture components
    implementation 'android.arch.lifecycle:extensions:1.1.1'
    implementation 'android.arch.paging:runtime:1.0.1'
    implementation 'android.arch.lifecycle:livedata:1.1.1'
    kapt 'android.arch.lifecycle:common-java8:1.1.1'
    kapt 'com.android.databinding:compiler:3.1.4'

    // AWS
    implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.8.4'
    implementation 'com.amazonaws:aws-android-sdk-s3:2.8.4'
    implementation 'com.amazonaws:aws-android-sdk-core:2.8.4'
    implementation 'com.amazonaws:aws-android-sdk-ddb:2.8.4'
//    implementation 'com.amazonaws:aws-android-sdk-ddb-document:2.8.4'

    // Others
    implementation 'com.github.sharish:CreditCardView:v1.0.4'
    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
    implementation 'pl.bclogic:pulsator4droid:1.0.3'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'me.relex:circleindicator:1.2.1@aar'
    implementation 'org.jetbrains.anko:anko:0.10.4'
    implementation 'com.github.santalu:mask-edittext:1.0.3'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.pwittchen:infinitescroll:0.0.2'

    implementation project(':room')
}

@lucasmpaim
Copy link

This erros occurs because the class android.support.v4.app.CoreComponentFactory is in com.android.support:support-compat:28.0.0 and androidx.core:core:1.0.0 which caused the conflict, for fix you need to exclude the dependency.

implementation('com.github.pwittchen:infinitescroll:0.0.2') {
        exclude group: 'androidx.core', module: 'core'
}

@pwittchen
Copy link
Owner

This is the problem @lucasmpaim explained. You can use provided solution or version 0.0.1 of the library, which doesn't use code from androix packages and it should work.

@rafagan
Copy link
Author

rafagan commented Dec 18, 2018

Thanks, I added inside dependencies:

implementation ('com.github.pwittchen:infinitescroll:0.0.2') {
        exclude group: 'androidx.core', module: '*'
        exclude group: 'com.google.android.material', module: 'material'
    }

And inside android:

packagingOptions {
        exclude 'META-INF/androidx.*'
        exclude 'META-INF/proguard/androidx-*'
    }

@pwittchen
Copy link
Owner

@rafagan is it working fine for you now?

@rafagan
Copy link
Author

rafagan commented Dec 19, 2018

Actually no. But I got the old version and it still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants