简体   繁体   English

Ionic 3 Android失败Build Manifest合并失败

[英]Ionic 3 Android Failed Build Manifest merger failed

I've checked a number of posts and Github issues but still not been able to solve this build error: 我检查了许多帖子和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.

I've tried adding cordova-android-support-gradle-release and other solutions from this post as well as other AndroidX solutions found in these posts: 我已经尝试从这篇文章以及这些文章中找到的其他AndroidX解决方案中添加cordova-android-support-gradle-release和其他解决方案:

https://github.com/material-components/material-components-android/issues/193 https://github.com/material-components/material-components-android/issues/193

Android Material and appcompat Manifest merger failed Android Material和Appcompat Manifest合并失败

To no avail. 无济于事。

I've even tried updating Android Studio to the latest version and tried the Migrate to AndroidX option from the refactor menu. 我什至尝试将Android Studio更新到最新版本,并尝试从重构菜单中选择“ Migrate to AndroidX选项。

Lastly, I have also tried using Cordova android@8 as well as @7.4.1 both with variations of the above. 最后,我还尝试了将Cordova android@8@7.4.1都用于上述两种版本。

I would have tried adding the following to the gradle.properties file, as suggested in the Github link above, however I don't have one of these in this Ionic project: 我会尝试按照上述Github链接中的建议将以下内容添加到gradle.properties文件中,但是在此Ionic项目中我没有其中之一:

android.useAndroidX=true
android.enableJetifier=true

As the error states, I've added tools:replace="android:appComponentFactory" to the application tag within AndroidManifest.xml 作为错误状态,我在AndroidManifest.xml的应用程序标签中添加了tools:replace="android:appComponentFactory"

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

请将此行写入应用程序标记中的AndroidManifest.xml文件:tools:replace =“ android:appComponentFactory”

在AndroidManifest文件的application标签中添加以下一行

tools:node="replace"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM