0

I am stuck with a build error due to some conflict as defined in the title. Here is my 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).

Here are my build.grade files:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.****.****"
    minSdkVersion 17
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-messaging:19.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'

implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'

implementation 'com.google.firebase:firebase-storage:18.0.0'

implementation 'com.sdsmdg.harjot:vectormaster:1.1.3'

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

The build.gradle at the Module level is:

buildscript {
ext.kotlin_version = '1.3.40'
repositories {
    google()
    jcenter()

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

}
}

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

}
}

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

Can someone please provide me a pointer towards what is the issue over here? The error started only recently after I updated android studio and also added firebase storage into it

Just to add:

implementation 'com.android.support:appcompat-v7:28.0.0'

gives me an error as follows:

Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='support-fragment', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.versionedparcelable', myArtifactId='versionedparcelable', myVersion='1.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies
7
  • you are mixing androidx libraries with the older support libraries. You need to switch your support libraries to ones that work with androidx.
    – jj.
    Jun 21, 2019 at 17:57
  • Yeah I understand that. But can't find where am I mixing it. No where have I directly used androidx
    – oTwo
    Jun 21, 2019 at 17:58
  • I believe your firebase version requires androidx.
    – jj.
    Jun 21, 2019 at 18:04
  • This post explains something similar to your problem.. stackoverflow.com/a/56667177/103131
    – jj.
    Jun 21, 2019 at 18:06
  • Did you tried to let Android Studio migrate to AndroidX for you automatically? Is under Refactor tab
    – Shermano
    Jun 21, 2019 at 18:06

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.