android解決tools:replace specified, but no new value specified

這說明你給manifest添加了屬性tools:replace
例如:

<application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:appComponentFactory">

解析:
你有多個依賴中的manifest中都存在android:appComponentFactory這個屬性,但他們的值不一樣,所以gradle就無法自動合併manifest。在<application>標籤裏先聲明tools:replace="android:appComponentFactory", 表示要手動指定那個屬性,然後再聲明android:appComponentFactory屬性,手動指定該屬性的值,即可。

報錯but no new value specified意思是你沒有繼續聲明android:appComponentFactory, 加上即可,例如:

<application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:appComponentFactory">

我遇到的是android:appComponentFactory,具體你要替換的屬性的值在提示加replace的錯誤log裏有。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章