android FileProvider 和三方的FileProvider衝突

問題提示:

Attribute provider#android.support.v4.content.FileProvider@authorities value=(com.example.xd.videotest) from AndroidManifest.xml:47:13-59
    is also present at [:ringtonelib-release:] AndroidManifest.xml:35:13-55 value=(net.xxx.app.provider).
    Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:45:9-53:20 to override.

 

在加入三方.arr後就報這樣的問題,搜了很久,發現是三方的FileProvider和我自己的FileProvider衝突了,所以解決辦法如下

 解決方案:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.xd.videotest"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"
tools:replace="android:resource" />
</provider>

爲其添加 tools:replace="android:authorities" tools:replace="android:resource"

我的問題是這樣解決的,如果 有不同的可以根據提示來解決

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