首页 > 解决方案 > 清单合并错误 - Nativescript 5.1

问题描述

当我尝试构建我的应用程序时,我遇到了这个 gradle 错误。我添加了 CLI 给出的建议,但它不起作用。

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:nativescript_camera:] AndroidManifest.xml:19:17-55
        is also present at [:MultiTypeFilePicker-release:] AndroidManifest.xml:46:17-51 value=(@xml/file_paths).
        Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

有什么帮助吗?

我正在使用 NativeScript 5.1/Angular 7。

谢谢!

标签: nativescriptnativescript-angular

解决方案


我已解决此问题,并添加:

xmlns:tools="http://schemas.android.com/tools"

到清单标头标签,然后添加:

<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.*.*.fileprovider" 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>

在应用程序标签内。

谢谢!


推荐阅读