如何修复React-Native Android中的“清单合并失败”?

沃兰亚麻布

清单合并失败:[com.android.support:support-compat:28.0.0]中的属性application @ appComponentFactory value =(android.support.v4.app.CoreComponentFactory)来自AndroidManifest.xml:22:18-91 [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value =(androidx.core.app.CoreComponentFactory)。建议:在AndroidManifest.xml:11:5-60:19的元素上添加'tools:replace =“ android:appComponentFactory”'以进行覆盖。

这是在升级本机版本之后

build.gradle

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "com.rugbyvault"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 16
        versionName "1.0"
        multiDexEnabled true
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
}
dependencies {
    implementation project(':tipsi-stripe')
    implementation project(':react-native-splash-screen')
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-keep-awake')
    implementation project(':react-native-code-push')
    implementation project(':react-native-sound')
    implementation(project(':react-native-firebase')) {
        transitive = false
    }
    implementation project(':react-native-svg')
    implementation project(':instabug-reactnative')
    implementation project(':react-native-picker')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'com.android.support:multidex:1.0.3'
    //noinspection GradleCompatible
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.google.android.gms:play-services-base:17.0.0"
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.android.gms:play-services-wallet:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
}
法塔布

似乎最新版本的react-native使用AndroidX库。因此,您需要将依赖项(在您的情况下:appcompatmultidex)升级到AndroidX。

仅供参考:AndroidX(androidx。*)是新的android支持库捆绑包(com.android.support。*)。

您应该替换以下行:

implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:28.0.0"

有了这些:

implementation 'androidx.multidex:multidex::2.0.1'
implementation "androidx.appcompat:appcompat:1.0.2"


将这些标志放在您的设备中 gradle.properties 可以解决一些相关问题:

android.enableJetifier=true
android.useAndroidX=true

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何修复 React Native 中的 ReactNavigation 错误

如何修复React Native中任务':app:processDebugManifest'的执行失败?

React Native Android构建错误:清单合并失败:属性application @ appComponentFactory

如何修复清单合并失败

如何修复 React-Native Android affineFormats 错误

如何修复错误Xcode中的React Native'UMCore'构建错误

如何在React Native中修复“无法找到方法'getConstants()'”

“如何修复react-native中的'handlePress'错误”

如何在React Native中修复Firebase / firestore错误?

如何在React Native中修复``错误:未知选项--projectRoot''

如何在React Native中修复'.then不是函数'

如何修复错误:变量在 react-native 中是只读的?

如何修复iOS中的react-native-date-picker?

如何修复 React Native 中的“无法运行 Jetifier”

如何修复 React Native 中的“npm start”错误?

如何修复 React-Native run-android 上的构建失败?

如何在Android的react-native中修复高程阴影问题

清单合并失败。添加并链接了react-native-device-info之后

如何在React-Native中修复“路线'Principal'的组件必须是React组件”错误

如何在 React Native 中修复文本元素中的cornerRadius

如何修复未定义不是React Native中setState上的对象

如何修复React Native中的“找不到模块” ... / template.config”错误

如何修复“没有连接的设备!” 在React Native的最新版本(0.59)中?

如何修复React-Native中的错误“您可能忘记了从文件..etc导出组件”错误?

访问本地主机api时如何修复react-native中的网络错误

在 React Native 中获取 php 文件时,如何修复 fetch 返回 404?

如何修复清单合并因多个错误而失败

如何在React Native中编辑平面清单项目

如何修复React Native中mergeitem中的'java.lang.String类型的值a无法转换为JSONObject'错误