首页 > 解决方案 > 清单合并在本机反应中失败

问题描述

在运行 react-native run-android 时,我遇到了异常。我已经尝试了一些我在谷歌上找到的更改,但没有工作。下面是我的异常和 gradle 文件。谷歌方面有任何更新吗?我怎样才能解决这个问题?我从昨天开始就面临这个问题。

清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91

构建 .gradle,..\app

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

dependencies {
    implementation project(':react-native-webview')
    implementation project(':react-native-i18n')
    implementation project(':react-native-device-info')
    implementation project(':@react-native-community_netinfo')
    implementation project(':@react-native-community_async-storage')
    implementation project(':react-native-camera')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  }

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.7'
    distributionUrl = distributionUrl.replace("bin", "all")

请建议..谢谢

标签: javascriptandroidreact-nativeandroid-gradle-plugin

解决方案


我解决了这个问题

npm uninstall react-native-device-info

接着

npm install --save react-native-device-info

最新版本应该是 2.1.2


推荐阅读