ERROR: Manifest merger failed : Attribute application@appComponentFactory 오류 처리
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:19:5-57:19 to override.
——————————-——————————-
apply plugin: ‘com.android.application’
android {
compileSdkVersion 28
buildToolsVersion “29.0.0”
defaultConfig {
applicationId “ddolcatmaster.smartstepcounter”
minSdkVersion 19
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 ‘com.android.support:appcompat-v7:28.0.0’
implementation ‘com.android.support.constraint:constraint-layout:1.1.3’
implementation ‘com.google.android.material:material:1.0.0’
implementation ‘com.google.firebase:firebase-messaging:20.0.1’
implementation ‘com.google.firebase:firebase-core:17.0.1’
implementation ‘com.google.firebase:firebase-ads:18.1.1’
implementation ‘com.google.firebase:firebase-crash:16.2.1’
implementation ‘androidx.work:work-runtime:2.2.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.crashlytics.sdk.android:crashlytics:2.10.1@aar’) {
transitive = true
}
}
apply plugin: ‘com.google.gms.google-services’
——————————-——————————-
[해결방법]gradle.properties 파일에 아래 두 줄을 추가 후 다시 빌드를 하면 해결된다.
android.useAndroidX=true
android.enableJetifier=true