環境:
AndroidStudio版本:3.3.2
win 10系統
AndroidStudio報錯信息:
> 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:23:5-39:19 to override.
出現這個問題後,按照一貫的做法,就是複製報錯信息百度,當然也解決了問題。感謝大牛的解決辦法和無私奉獻。
查找一圈後,還是連環報錯,接着,我按照系統提示的方法試了試,還真解決了。
對於本版本的AndroidStudio,解決辦法如下:
- 在Manifest.xml 文件下application中添加如下一行代碼
<application
......
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory">
對於做了以上更改後還是報錯的情況,請參考下面的文章:
AndroidStudio報錯Manifest merger failed : Attribute application@appComponentFactory