TakePhoto icon indicating copy to clipboard operation
TakePhoto copied to clipboard

和蒲公英的SDK冲突-provider冲突

Open linq8261 opened this issue 7 years ago • 5 comments

<provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:grantUriPermissions="true"
    android:exported="false">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>

蒲公英的SDK也有这个provider,name相同,值不同。

// 蒲公英
compile 'com.pgyersdk:sdk:2.4.5'

// 选择图片
//    compile 'com.jph.takephoto:takephoto_library:4.0.0'  // 编译不过,不造为何
compile 'com.jph.takephoto:takephoto_library:3.0.2'
:app:processDebugManifest
E:\OKGO\app\src\main\AndroidManifest.xml:13:13-56 Error:
	Attribute provider#android.support.v4.content.FileProvider@authorities value=(com.pgyersdk.provider) from [com.pgyersdk:sdk:2.4.5] AndroidManifest.xml:13:13-56
	is also present at [com.jph.takephoto:takephoto_library:3.0.2] AndroidManifest.xml:19:13-64 value=(com.audienl.okgo.fileprovider).
	Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:11:9-19:20 to override.
E:\OKGO\app\src\main\AndroidManifest.xml:18:17-55 Error:
	Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [com.pgyersdk:sdk:2.4.5] AndroidManifest.xml:18:17-55
	is also present at [com.jph.takephoto:takephoto_library:3.0.2] AndroidManifest.xml:24:17-51 value=(@xml/file_paths).
	Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.


See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:app:processDebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2.552 secs

linq8261 avatar Nov 23 '16 08:11 linq8261

同问 引入lib 中包含file_paths文件 自己能否再写一个

zabio avatar Dec 26 '16 04:12 zabio

@zabio 可以的。在你自己项目的AndroidManifest.xml的provider节点上添tools:replace="android:authorities"' 上面那哥们的编译报错里面有写 add 'tools:replace="android:authorities"' to element at AndroidManifest.xml

vnicers avatar Jan 03 '17 06:01 vnicers

@vnice 可以用么?我按照你的改了?下载完后不能自动安装。

cuijianzhi avatar Mar 10 '17 05:03 cuijianzhi

@AudienL @zabio 可以看看这个http://blog.csdn.net/R3lish/article/details/58147225 。注意大小写.

cuijianzhi avatar Mar 10 '17 10:03 cuijianzhi

@cuijianzhi 解决问题 3Q

EternalPlan avatar Jun 20 '19 03:06 EternalPlan