Photoview: Manifest merger failed : Attribute application@appComponentFactory

Created on 17 Oct 2018  路  4Comments  路  Source: Baseflow/PhotoView

I got this Error when I tried to implement photoView.
I also tried that suggestion but it's not a solution, it not worked.

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:9:5-49:19 to override.

Most helpful comment

Downgrade to
implementation 'com.github.chrisbanes:PhotoView:2.1.4'

All 4 comments

I fixed it by using an other library 鉁岋笍

It has to do with AndroidX. Either you can downgrade the PhotoView dependency or upgrade to AndroidX

Downgrade to
implementation 'com.github.chrisbanes:PhotoView:2.1.4'

Downgrade to
implementation 'com.github.chrisbanes:PhotoView:2.1.4'

This is the instant solution to resolve this issue, however, if for any reason, you require the fixes and features implemented from 2.1.5 onwards (e.g. current latest version is 2.3.0), you can migrate your project to AndroidX.

Below are the steps to perform the migration using Android Studio. It is pretty handy as it will also prompt you to back up your existing code as a ZIP file prior to the migration.

With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

Read more about the migration to AndroidX here: https://developer.android.com/jetpack/androidx/migrate

Was this page helpful?
0 / 5 - 0 ratings