简体   繁体   中英

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:

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:

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

Android Material and appcompat Manifest merger failed

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.

Lastly, I have also tried using Cordova android@8 as well as @7.4.1 both with variations of the above.

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:

android.useAndroidX=true
android.enableJetifier=true

As the error states, I've added tools:replace="android:appComponentFactory" to the application tag within 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

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

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

tools:node="replace"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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