正在做一个项目,但突然停止了;开始给出错误:

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.

我知道谷歌在28岁之后已经完成了支持库类的工作,我知道如何将整个项目从支持库类迁移到AndroidX类.

我的问题是:

  • 有没有可能继续使用Support Library类而不是转向AndroidX类?

  • 如何解决这个问题?

推荐答案

你可以锁定你的谷歌服务和firebase版本以避免androidX.

在android/build中.格雷德尔补充道:

buildscript {
  ...
  ext {
    // Lock down googlePlayServicesVersion
    googlePlayServicesVersion = "16.1.0"
    firebaseVersion = "17.6.0"
  }
}

或者在格拉德尔.属性添加:

googlePlayServicesVersion=16.1.0
firebaseVersion=17.6.0

React-native相关问答推荐

react 本机 TextInput 将其他元素移出屏幕

什么是 expoClientId?

错误:图片:找不到 ID 为1的assets资源 .请判断图像源或打包器

react-native-snap-carousel 无法正确渲染

使用 .env 变量在 react-native 应用程序上设置 appcenter

如何解决此错误您可能需要适当的加载程序来处理此文件类型

我们如何将 Firebase Analytics 与基于 expo 的 react-native 应用程序一起使用

如何使用功能组件向 ref 公开功能?

将图标添加到drawer抽屉react-navigation v5

在配置 react-native-maps 中获取 "supportLibVersion" 、 "playServicesVersion" 和 "androidMapsUtilsVersion" 值

带有 xcode 模拟器的 react-native 有非常慢的alert

> 任务 :app:checkDebugAarMetadata 在运行 react-native run-android 时失败

如何知道 FlatList 中的滚动状态?

无法在react-native元素中扩展 Zip

我将如何根据百分比为按钮的宽度设置动画,并且它的背景 colored颜色 也是如此?

React-Native 最低 Android API 级别

Android 是否支持 React Native 的 LayoutAnimation?

react-native图像预取

react-navigation 标题有一条微弱的线

移动应用程序不需要 CORS?