[Android] AndroidX 相容問題
1 min readJul 8, 2019
Run app時遇到的問題:
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–21:19 to override.
相信你可以一秒看出是個相容問題,兩秒也可以
Sol:
project目錄按下右鍵 -> Refactor -> Migrate to AndroidX
善良的Android Studio會幫你先壓一個zip,避免壞掉
好,相信這樣就解決了
讓我們繼續加油 (wave)