lau*_*ent 3 android build react-native androidx
升级到RN 0.59.9后,我正在尝试构建React Native Android应用程序,但出现与AndroidX相关的错误。
我尝试了很多事情,包括删除大多数本地包,更改AndroidManifest.xml以及Internet上提到的各种其他解决方案,但似乎没有任何效果。
我的错误是这样的:
> Task :app:processReleaseManifest FAILED
....\android\app\src\main\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:35:2-108:16 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)
据我了解,这意味着其中一个软件包使用AndroidX,但不使用主应用程序,但是据我所知,我的应用程序中没有使用AndroidX,因此我确保升级到RN 0.59,而不是0.60。我什至尝试grep“ androidx”并删除所有可能提及它的软件包。
我还尝试向gradle.properties中添加“ android.useAndroidX = true / android.enableJetifier = true”,以查看发生了什么,但是按预期,由于尚未升级到AndroidX,许多模块无法构建。
任何想法如何解决此错误?
这很可能是由于Android释放了所有AndroidX库,并且泄漏了“ +”样式的gradle依赖项。
要么你可以./gradlew :app:dependencies|grep androidx找到问题库,然后使用gradle这个resolutionStrategies或Android / EXT的build.gradle {}版本钉住谷歌图书馆的依赖,或者你可以将你的反应本地项目androidx,并通过使用jetifier工具npm i jetifier && npx jetify,使非-androidx react-native库工作。
当本机生态系统过渡到AndroidX时,这两种方法都应能正常工作
| 归档时间: |
|
| 查看次数: |
515 次 |
| 最近记录: |