react-native 编译出错 —— Manifest merger failed
Manifest merger failed —— Androidx
中间尝试了很多方式,都不行!比如
manifest/application中添加
android:appComponentFactory="" tools:replace="android:appComponentFactory"
或者
gradle.properties中写入
android.useAndroidX=true android.enableJetifier=true
错误展示
- 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 element at AndroidManifest.xml:7:5-117 to override.
昨天项目好好的,今个一大早运行编译就报错!!
游遍整个 Internet 发现,竟然和 AndroidX 有毛关系!!!
定位错误原因
错误的原因: Androidx之前的安卓support库已经存在当前最新的Androidx support库中,他俩不能共存。而事实是共存了,因此编译时候就导致资源合并异常!
到底是怎么共存的?反正我在android/app的gradle中是没有引入。很容易猜想到libraries —— 引入的第三方库。是的!!
确定解决方案
接下来的解决思路是,怎么去查哪个库引入了Androidx的东西??然后去掉对Androidx的引用(去掉方式就是使用那个没引用Androidx的版本)
查看哪些库依赖了Androidx,在android目录下执行命令
cd android/ && ./gradlew :app:dependenciess
下面看下我的(翻到最后一个~)
releaseUnitTestRuntimeClasspath - Resolved configuration for runtime for variant: releaseUnitTest
+--- project :react-native-fast-image
| +--- com.facebook.react:react-native:+ -> 0.59.9
| | +--- com.facebook.infer.annotation:infer-annotation:0.11.2
| | | \--- com.google.code.findbugs:jsr305:3.0.1 -> 3.0.2
| | +--- javax.inject:javax.inject:1
| | +--- com.android.support:appcompat-v7:28.0.0
| | | +--- com.android.support:support-annotations:28.0.0
| | | +--- com.android.support:support-compat:28.0.0
| | | | +--- com.android.support:support-annotations:28.0.0
| | | | +--- com.android.support:collections:28.0.0
| | | | | \--- com.android.support:support-annotations:28.0.0
| | | | +--- android.arch.lifecycle:runtime:1.1.1
| | | | | +--- android.arch.lifecycle:common:1.1.1
| | | | | | \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
| | | | | +--- android.arch.core:common:1.1.1
| | | | | | \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
| | | | | \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
| | | | \--- com.android.support:versionedparcelable:28.0.0
| | | | +--- com.android.support:support-annotations:28.0.0
| | | | \--- com.android.support:collections:28.0.0 (*)
| | | +--- com.android.support:collections:28.0.0 (*)
| | | +--- com.android.support:cursoradapter:28.0.0
| | | | \--- com.android.support:support-annotations:28.0.0
| | | +--- com.android.support:support-core-utils:28.0.0
| | | | +--- com.android.support:support-annotations:28.0.0
| | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | +--- com.android.support:documentfile:28.0.0
| | | | | \--- com.android.support:support-annotations:28.0.0
| | | | +--- com.android.support:loader:28.0.0
| | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | +--- android.arch.lifecycle:livedata:1.1.1
| | | | | | +--- android.arch.core:runtime:1.1.1
| | | | | | | +--- com.android.support:support-annotations:26.1.0 -> 28.0.0
| | | | | | | \--- android.arch.core:common:1.1.1 (*)
| | | | | | +--- android.arch.lifecycle:livedata-core:1.1.1
| | | | | | | +--- android.arch.lifecycle:common:1.1.1 (*)
| | | | | | | +--- android.arch.core:common:1.1.1 (*)
| | | | | | | \--- android.arch.core:runtime:1.1.1 (*)
| | | | | | \--- android.arch.core:common:1.1.1 (*)
| | | | | \--- android.arch.lifecycle:viewmodel:1.1.1
| | | | | \--- com.android.support:support-annotations:26.1.0 -> 28.0.0
| | | | +--- com.android.support:localbroadcastmanager:28.0.0
| | | | | \--- com.android.support:support-annotations:28.0.0
| | | | \--- com.android.support:print:28.0.0
| | | | \--- com.android.support:support-annotations:28.0.0
| | | +--- com.android.support:support-fragment:28.0.0
| | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | +--- com.android.support:support-core-ui:28.0.0
| | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | +--- com.android.support:support-core-utils:28.0.0 (*)
| | | | | +--- com.android.support:customview:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | \--- com.android.support:support-compat:28.0.0 (*)
| | | | | +--- com.android.support:viewpager:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | | \--- com.android.support:customview:28.0.0 (*)
| | | | | +--- com.android.support:coordinatorlayout:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | | \--- com.android.support:customview:28.0.0 (*)
| | | | | +--- com.android.support:drawerlayout:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | | \--- com.android.support:customview:28.0.0 (*)
| | | | | +--- com.android.support:slidingpanelayout:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | | \--- com.android.support:customview:28.0.0 (*)
| | | | | +--- com.android.support:interpolator:28.0.0
| | | | | | \--- com.android.support:support-annotations:28.0.0
| | | | | +--- com.android.support:swiperefreshlayout:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | +--- com.android.support:support-compat:28.0.0 (*)
| | | | | | \--- com.android.support:interpolator:28.0.0 (*)
| | | | | +--- com.android.support:asynclayoutinflater:28.0.0
| | | | | | +--- com.android.support:support-annotations:28.0.0
| | | | | | \--- com.android.support:support-compat:28.0.0 (*)
| | | | | \--- com.android.support:cursoradapter:28.0.0 (*)
| | | | +--- com.android.support:support-core-utils:28.0.0 (*)
| | | | +--- com.android.support:support-annotations:28.0.0
| | | | +--- com.android.support:loader:28.0.0 (*)
| | | | \--- android.arch.lifecycle:viewmodel:1.1.1 (*)
| | | +--- com.android.support:support-vector-drawable:28.0.0
| | | | +--- com.android.support:support-annotations:28.0.0
| | | | \--- com.android.support:support-compat:28.0.0 (*)
| | | \--- com.android.support:animated-vector-drawable:28.0.0
| | | +--- com.android.support:support-vector-drawable:28.0.0 (*)
| | | \--- com.android.support:support-core-ui:28.0.0 (*)
| | +--- com.facebook.fresco:fresco:1.10.0
| | | +--- com.facebook.fresco:fbcore:1.10.0
| | | +--- com.facebook.fresco:drawee:1.10.0
| | | | +--- com.facebook.fresco:fbcore:1.10.0
| | | | \--- com.facebook.fresco:imagepipeline:1.10.0
| | | | +--- com.facebook.fresco:imagepipeline-base:1.10.0
| | | | | +--- com.facebook.soloader:soloader:0.5.0 -> 0.6.0
| | | | | +--- com.parse.bolts:bolts-tasks:1.4.0
| | | | | \--- com.facebook.fresco:fbcore:1.10.0
| | | | +--- com.facebook.soloader:soloader:0.5.0 -> 0.6.0
| | | | +--- com.parse.bolts:bolts-tasks:1.4.0
| | | | \--- com.facebook.fresco:fbcore:1.10.0
| | | +--- com.facebook.fresco:imagepipeline:1.10.0 (*)
| | | \--- com.facebook.soloader:soloader:0.5.0 -> 0.6.0
| | +--- com.facebook.fresco:imagepipeline-okhttp3:1.10.0
| | | +--- com.squareup.okhttp3:okhttp:3.10.0 -> 3.12.1
| | | | \--- com.squareup.okio:okio:1.15.0
| | | +--- com.facebook.fresco:fbcore:1.10.0
| | | \--- com.facebook.fresco:imagepipeline:1.10.0 (*)
| | +--- com.facebook.soloader:soloader:0.6.0
| | +--- com.google.code.findbugs:jsr305:3.0.2
| | +--- com.squareup.okhttp3:okhttp:3.12.1 (*)
| | +--- com.squareup.okhttp3:okhttp-urlconnection:3.12.1
| | | \--- com.squareup.okhttp3:okhttp:3.12.1 (*)
| | \--- com.squareup.okio:okio:1.15.0
| +--- com.android.support:support-v4:28.0.0
| | +--- com.android.support:support-compat:28.0.0 (*)
| | +--- com.android.support:support-media-compat:28.0.0
| | | +--- com.android.support:support-annotations:28.0.0
| | | +--- com.android.support:support-compat:28.0.0 (*)
| | | \--- com.android.support:versionedparcelable:28.0.0 (*)
| | +--- com.android.support:support-core-utils:28.0.0 (*)
| | +--- com.android.support:support-core-ui:28.0.0 (*)
| | \--- com.android.support:support-fragment:28.0.0 (*)
| +--- com.github.bumptech.glide:glide:4.7.1
| | +--- com.github.bumptech.glide:gifdecoder:4.7.1
| | | \--- com.android.support:support-annotations:27.1.1 -> 28.0.0
| | +--- com.github.bumptech.glide:disklrucache:4.7.1
| | +--- com.github.bumptech.glide:annotations:4.7.1
| | \--- com.android.support:support-fragment:27.1.1 -> 28.0.0 (*)
| +--- com.github.bumptech.glide:annotations:4.7.1
| \--- com.github.bumptech.glide:okhttp3-integration:4.7.1
| +--- com.github.bumptech.glide:glide:4.7.1 (*)
| +--- com.squareup.okhttp3:okhttp:3.9.1 -> 3.12.1 (*)
| \--- com.android.support:support-annotations:27.1.1 -> 28.0.0
+--- project :react-native-gesture-handler
+--- project :react-native-wechat
| \--- com.facebook.react:react-native:+ -> 0.59.9 (*)
+--- project :react-native-code-push
| +--- com.facebook.react:react-native:+ -> 0.59.9 (*)
| \--- com.nimbusds:nimbus-jose-jwt:5.1
| +--- com.github.stephenc.jcip:jcip-annotations:1.0-1
| \--- net.minidev:json-smart:[1.3.1,2.3] -> 2.3
| \--- net.minidev:accessors-smart:1.2
| \--- org.ow2.asm:asm:5.0.4
+--- project :react-native-device-info
| +--- com.facebook.react:react-native:+ -> 0.59.9 (*)
| \--- com.google.android.gms:play-services-gcm:+ -> 17.0.0
| +--- androidx.collection:collection:1.0.0
| | \--- androidx.annotation:annotation:1.0.0
| +--- androidx.core:core:1.0.0
| | +--- androidx.annotation:annotation:1.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | +--- androidx.lifecycle:lifecycle-common:2.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.arch.core:core-common:2.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | \--- androidx.versionedparcelable:versionedparcelable:1.0.0
| | +--- androidx.annotation:annotation:1.0.0
| | \--- androidx.collection:collection:1.0.0 (*)
| +--- androidx.legacy:legacy-support-core-utils:1.0.0
| | +--- androidx.annotation:annotation:1.0.0
| | +--- androidx.core:core:1.0.0 (*)
| | +--- androidx.documentfile:documentfile:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | +--- androidx.loader:loader:1.0.0
| | | +--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.core:core:1.0.0 (*)
| | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0
| | | | +--- androidx.arch.core:core-runtime:2.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
| | | | | +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
| | | | | +--- androidx.arch.core:core-common:2.0.0 (*)
| | | | | \--- androidx.arch.core:core-runtime:2.0.0 (*)
| | | | \--- androidx.arch.core:core-common:2.0.0 (*)
| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
| | | \--- androidx.annotation:annotation:1.0.0
| | \--- androidx.print:print:1.0.0
| | \--- androidx.annotation:annotation:1.0.0
| +--- com.google.android.gms:play-services-base:17.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.core:core:1.0.0 (*)
| | +--- androidx.fragment:fragment:1.0.0
| | | +--- androidx.core:core:1.0.0 (*)
| | | +--- androidx.legacy:legacy-support-core-ui:1.0.0
| | | | +--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.core:core:1.0.0 (*)
| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | +--- androidx.customview:customview:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | \--- androidx.core:core:1.0.0 (*)
| | | | +--- androidx.viewpager:viewpager:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.coordinatorlayout:coordinatorlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.drawerlayout:drawerlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.slidingpanelayout:slidingpanelayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.customview:customview:1.0.0 (*)
| | | | +--- androidx.interpolator:interpolator:1.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0
| | | | +--- androidx.swiperefreshlayout:swiperefreshlayout:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | +--- androidx.core:core:1.0.0 (*)
| | | | | \--- androidx.interpolator:interpolator:1.0.0 (*)
| | | | +--- androidx.asynclayoutinflater:asynclayoutinflater:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0
| | | | | \--- androidx.core:core:1.0.0 (*)
| | | | \--- androidx.cursoradapter:cursoradapter:1.0.0
| | | | \--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | +--- androidx.annotation:annotation:1.0.0
| | | +--- androidx.loader:loader:1.0.0 (*)
| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:17.0.0
| | | +--- androidx.collection:collection:1.0.0 (*)
| | | +--- androidx.core:core:1.0.0 (*)
| | | \--- androidx.fragment:fragment:1.0.0 (*)
| | \--- com.google.android.gms:play-services-tasks:17.0.0
| | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| +--- com.google.android.gms:play-services-iid:[17.0.0] -> 17.0.0
| | +--- androidx.collection:collection:1.0.0 (*)
| | +--- androidx.core:core:1.0.0 (*)
| | +--- com.google.android.gms:play-services-base:17.0.0 (*)
| | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | +--- com.google.android.gms:play-services-stats:17.0.0
| | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| \--- com.google.android.gms:play-services-stats:17.0.0 (*)
+--- project :react-native-view-shot
| +--- com.facebook.react:react-native:+ -> 0.59.9 (*)
| \--- com.android.support:support-v4:27.+ -> 28.0.0 (*)
+--- project :react-native-svg
| \--- com.facebook.react:react-native:+ -> 0.59.9 (*)
+--- project :react-native-wheel-picker-android
| +--- com.android.support:appcompat-v7:28.0.0 (*)
| +--- com.facebook.react:react-native:+ -> 0.59.9 (*)
| \--- cn.aigestudio.wheelpicker:WheelPicker:1.1.2
+--- project :react-native-linear-gradient
+--- project :react-native-image-picker
| \--- com.facebook.react:react-native:+ -> 0.59.9 (*)
+--- project :react-native-i18n
| \--- com.facebook.react:react-native:+ -> 0.59.9 (*)
+--- com.android.support:appcompat-v7:28.0.0 (*)
+--- com.facebook.react:react-native:+ -> 0.59.9 (*)
\--- :dx-captcha-1.4.8
然后发现就是react-native-device-info
这个函数库引用了 Androidx
出错版本:"react-native-device-info": "^0.24.3"
修改到正确版本: "react-native-device-info": "^2.1.2"
然后,执行命令:
npm install && npm audit fix
更新到指定版本就好。
参考资料:
https://github.com/facebook/react-native/issues/25294
https://blog.csdn.net/sunny_1020/article/details/88556251
react-native 编译出错 —— Manifest merger failed相关推荐
- 快速解决Android编译报错 : Manifest merger failed with multiple errors, see logs
快速解决Android编译报错 : Manifest merger failed with multiple errors, see logs 编译项目的时候,遇到Android Manifest合并 ...
- 如何查找Manifest merger failed with multiple errors问题原因
做android程序,在gradle文件中免不了引入第三方的库,添加库之后,同步gradle,碰到Manifest merger failed with multiple errors问题,也不是什么 ...
- Android Manifest merger failed with multiple errors参考解决方法
判断报错类别 Android Manifest merger failed with multiple errors , see logs 主要分为俩类(个人遇见的情况): 与引入的其他库中的Mani ...
- Manifest merger failed
针对以下两个错误 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/Animato ...
- 解决Manifest merger failed : Attribute application@appComponentFactory
在将butterknife升级到10.0.0的时候遇到问题,编译无法通过. Manifest merger failed : Attribute application@appComponentFac ...
- Manifest merger failed with multiple errors, see logs解决方案
Manifest merger failed with multiple errors, see logs解决方案 组件化开发,在测试单个组件的时候,有时编译会出现这样的问题 以本人的项目模拟: 当前 ...
- Manifest merger failed with multiple errors, see logs问题处理
在android开发的时候,有时候会遇到这样的问题 Error:Execution failed for task ':test:processDebugManifest'. > Manifes ...
- Manifest merger failed with multiple errors
Execution failed for task ':app:processDebugManifest'. > Manifest merger failed with multiple err ...
- Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed with multipl
使用Android studio build时出现的: Android studio(以下简称AS)项目中引用自己的Library编译时出现的一些问题 Message Gradle build Err ...
最新文章
- llvm常见问题 (FAQ)
- R语言CRAN不包含的安装包下载并手动使用RStudio进行安装实战:以下载VRPM包及绘制彩色列线图为例
- arm920T与arm926的区别[转载]
- 5个IO口扫描25个按键的解决方法(转帖)
- Linux学习:makefile介绍
- 31 | 套路篇:磁盘 I/O 性能优化的几个思路
- hadoop上lzop的安装
- 数据结构-树1-概念
- Ubuntu下apache配置文件路径
- 李开复:一生换四五次工作在21世纪很正常
- build openposewith opencv-2.4.13,cuda9(9.0 - 9.2)
- python38环境变量的配置_Windows下python环境变量配置
- kubernetes视频教程笔记 (24)-存储-PV和PVC
- WINDOWS BAT的命令,双引号位置要注意
- 计算机房装修对门的要求,机房建设标准要求
- MATLAB简单实现ID3算法
- Win11任务栏不显示时间怎么办?Win11任务栏不显示时间的解决方法
- 如何将Excel一页转PDF变多页?好用的PDF转换工具推荐
- 1949-2020年各省全要素生产率(年度)
- 来自Gartner 中国分析师的最新见解
热门文章
- 大型体育赛事无线通信系统
- C语言小恶搞之猜数字游戏
- CoreAnimation4-隐式动画和显式动画
- Python爬虫整理资料素材下载动漫壁纸实战案例8
- php汽车销售管理系统论文,php汽车销售毕业设计管理系统
- utf8和utf8mb4区别
- mysql utf8mb4_general_ci_MySQL 编码utf8 与 utf8mb4 utf8mb4_unicode_ci 与 utf8mb4_general_ci
- 松灵机器人二次开发总结
- Android 获取Wifi列表详解(包含动态权限申请)
- 技术分享 | ClickHouse 冷热存储分离方案线上实践