简体   繁体   English

清单合并失败 android.support.v4.app.CoreComponentFactory

[英]Manifest merger failed android.support.v4.app.CoreComponentFactory

Error given:给出的错误:

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).

Gradle dependencies Gradle 依赖项

dependencies {
implementation project(':react-native-image-resizer')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-device-info')
implementation project(':react-native-camera')
implementation project(':react-native-agora')
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

implementation "com.facebook.react:react-native:+"  // From node_modules
implementation 'com.getkeepsafe.relinker:relinker:1.3.0'
implementation 'com.android.volley:volley:1.1.0'
implementation files('src/main/jniLibs/HCNetSDK.jar')
implementation files('src/main/jniLibs/PlayerSDK.jar')
implementation 'com.ncorti:slidetoact:0.5.1'
implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.pusher:push-notifications-android:1.0.2'
}

Edit: This GitHub ticket helped me solve it, seemed to be an androidx and react-native problem.编辑:这张GitHub 票帮助我解决了它,似乎是一个 androidx 和 react-native 问题。 Got gms and firebase versions here在这里有 gms 和 firebase 版本

You need to migrate to AndroidX from andorid.support and android.arch dependencies.您需要从 andorid.support 和 android.arch 依赖项迁移到 AndroidX。 Your project is having conflicts as the error message says probably because of react native depencencies,您的项目有冲突,因为错误消息可能是因为响应本机依赖,

This link should be helpful这个链接应该有帮助

Take a look also here也看看这里

TL;DR Get rid of all andorid.support and android.arch dependencies and use androidX instead TL;DR 摆脱所有andorid.supportandroid.arch依赖项并改用 androidX

for example change例如改变

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

into进入

implementation 'androidx.constraintlayout:constraintlayout:1.1.2' , implementation 'androidx.constraintlayout:constraintlayout:1.1.2' ,

second example change第二个示例更改

implementation 'com.android.support:animated-vector-drawable:28.0.0'

into进入

implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'

and do similar for all support dependencies并对所有支持依赖项执行类似操作

I solved it by including the following within app/build.gradle: 我通过在app/build.gradle:包含以下内容解决了该问题app/build.gradle:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Put these flags in your gradle.properties 将这些标志放在gradle.properties中

android.enableJetifier=true
android.useAndroidX=true

Changes in gradle : gradle的变化:

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha04'

Refer to: https://developer.android.com/jetpack/androidx/migrate 请参阅: https//developer.android.com/jetpack/androidx/migrate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM