【发布时间】:2020-01-03 00:08:37
【问题描述】:
我检查了许多帖子和 Github 问题,但仍然无法解决此构建错误:
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:5:5-36:19 to override.
我已尝试添加 cordova-android-support-gradle-release 和来自此 post 的其他解决方案以及在这些帖子中找到的其他 AndroidX 解决方案:
https://github.com/material-components/material-components-android/issues/193
Android Material and appcompat Manifest merger failed
无济于事。
我什至尝试将 Android Studio 更新到最新版本,并尝试了重构菜单中的 Migrate to AndroidX 选项。
最后,我还尝试使用 Cordova android@8 和 @7.4.1 两者都有上述变化。
我会尝试按照上面的 Github 链接中的建议将以下内容添加到 gradle.properties 文件中,但是我在这个 Ionic 项目中没有其中之一:
android.useAndroidX=true
android.enableJetifier=true
如错误所示,我已将tools:replace="android:appComponentFactory" 添加到AndroidManifest.xml 内的应用程序标签中
BUILD FAILED in 4s
/Users/xxxxxxxxxx/Development/xxxxxxxxxx/mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
/Users/xxxxxxxxxx/Development/xxxxxxxxxx/mobile/platforms/android/app/src/main/AndroidManifest.xml:5:5-36:19 Error:
tools:replace specified at line:5 for attribute android:appComponentFactory, but no new value specified
/Users/simontaylor/Development/Rehab Guru/mobile/platforms/android/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
【问题讨论】:
标签: android cordova ionic-framework ionic3