错误:任务':app:processDebugManifest'的执行失败

时间:2019-06-18 13:12:43

标签: react-native

几天前它在工作。我什么也没更新。 删除了node_modules文件夹-一样。

可能出了什么问题?请指向它。

已经尝试添加到AndroidManifest.xml:

- tools:node="replace"
or
- tools:replace="android:appComponentFactory"
  android:appComponentFactory="whatever"

没有帮助。

build.gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 19
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
        googlePlayServicesAuthVersion = "15.0.1"
    }
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

这是来自控制台的错误

> Task :app:processDebugManifest FAILED
...\android\app\src\debug\AndroidManifest.xml:22:18-91 Error:
        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 <application> element at AndroidManifest.xml:7:5-117 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> 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 <application> element at AndroidManifest.xml:7:5-117 to override.

2 个答案:

答案 0 :(得分:3)

升级react-native-device-info也将起作用 yarn upgrade react-native-device-info@2.1.2

答案 1 :(得分:2)

尝试强行包括库。 为此,将这些行复制到以下位置:android->app->build.gradel。 这些行如下:

configurations.all { 
  resolutionStrategy { 
    force 'com.google.android.gms:play-services-gcm:16.1.0' 
    force 'com.google.android.gms:play-services-base:16.1.0' 
    force 'com.google.firebase:firebase-core:16.0.9' 
    force 'com.google.firebase:firebase-messaging:18.0.0' 
  }
}

这只是临时修复。