android build_error ai_generated true

Execution failed for task ':app:processDebugMainManifest'. Manifest merger failed : Attribute application@appComponentFactory

ID: android/manifest-merger-failed

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
8 active

Root Cause

AndroidManifest.xml merge conflict between app and library manifests. Conflicting attributes, SDK versions, or duplicate permissions.

generic

Workarounds

  1. 92% success Use tools:replace on specific conflicting attributes
    <application tools:replace="android:appComponentFactory" ...>  <!-- add xmlns:tools in manifest tag -->

    Sources: https://developer.android.com/reference/

  2. 88% success Align minSdkVersion with library requirements
    Check error for required min SDK; update android { defaultConfig { minSdk = 24 } }  // match library requirement
  3. 85% success Use the manifest merger report to find exact conflicts
    ./gradlew processDebugMainManifest --stacktrace; check app/build/outputs/logs/manifest-merger-*-report.txt

Dead Ends

Common approaches that don't work:

  1. Delete the app's AndroidManifest.xml and let it regenerate 90% fail

    The app manifest is the source of truth. Deleting it removes your custom config (permissions, activities, intent filters).

  2. Add tools:replace to every conflicting attribute one by one 72% fail

    Blindly overriding library attributes can break their functionality. Understand what each library needs.