我更新了android.支持:appcompat-v7'至28.0.0.

但它带来了一个构建错误.

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:8:5-23:19 to override.

然后我的日志(log)中出现了这个错误:

合并失败

我的apply.格雷德尔:

  configurations.all {
    resolutionStrategy.force 'com.android.support:design:28.0.0'
    resolutionStrategy.force "com.android.support:support-v4:28.0.0"
    resolutionStrategy.force "com.android.support:support-media-compat:28.0.0"
  }
...
dependencies {
  implementation 'com.android.support:multidex:1.0.1'

  // Our dependencies
  implementation 'com.android.support:appcompat-v7:28.0.0'


  implementation 'com.android.support:appcompat-v7:28.0.0'
}

我该怎么修?

我需要你的解决方案.

提前谢谢你.

推荐答案

我通过搜索@MehulSolanki-answer找到了一个解决方案.

我补充说

tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"

在我的AndroidManifest.xml岁生日派对上

并更新com.安卓工具.建造:格拉德尔:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
  }

把这个加到你的渐变里.属性文件

android.useAndroidX=true
android.enableJetifier=true

错误:[TAG]无法解析变量"${animal.sniffer.version}"

错误:[TAG]无法解析变量"${junit.version}"

如果出现上述错误

  1. File -> Invalidate Caches / restart
  2. Build -> Clean project

错误:打包android.支持注释不存在

如果出现上述错误

implementation 'androidx.annotation:annotation:1.1.0'

change import android.support.annotation.Nullable; => androidx.annotation.Nullable;

change import android.support.annotation.NonNull; => androidx.annotation.NonNull;

Compile versiontarget version应该是28.

React-native相关问答推荐

无法解析 com.google.gms:google-services:4.3.15

React Native 无法下载模板

React Native:任务 ':app:checkDebugDuplicateClasses' 执行失败

无法在 M1 zsh 上运行 adb segmentation fault adb

react-native-firebase crashlytics 未显示在 firebase 仪表板上

React中类似于 React Native 中的 FlatList

图像背景ResizeMode调整大小模式

异步(async)/等待(await)和递归

React-native 在浏览器中打开链接并返回应用程序

如何在 React-Native Android 中检测拖动事件的结束

带有 react-navigation 的 DrawerNavigation 标头

以编程方式在 React Native 中添加组件

React Native 创建自定义组件/库

require() 必须有一个字符串文字参数 React Native

在 React Native App 中禁用屏幕捕获/ScreenShot

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

在 React Native 中,如何使用浅渲染测试我的组件?

使用 React Native 和 Redux 的动画状态管理

试图在一个本应是不可变且已被冻结的对象上设置密钥

如何允许 react-native 启用对 JSX(扩展)文件的支持