tjvantoll / nativescript-social-share

♻️ A NativeScript plugin for using the iOS/Android social sharing widgets
MIT License
94 stars 48 forks source link

AndroidManifest - Merging issues #58

Open csimpi opened 4 years ago

csimpi commented 4 years ago

After installing the plugin I'm getting this error message:

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

I'm having the same problem. Did you find a solution?

csimpi commented 4 years ago

@ouelleta Unfortunately I didn't.

ouelleta commented 4 years ago

Seems to work when I add those 2 providers under < application>.

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.provider"
    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>

<provider 
    android:name="android.support.v4.content.FileProvider" 
    android:authorities="${applicationId}.provider"
    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>

xmlns:tools="http://schemas.android.com/tools" must also be added to < manifest>

glintpursuit commented 3 years ago

@ouelleta Does below line does not allow file_paths resources from other libraries ?

<meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
            android:resource="@xml/file_paths" 
            tools:replace="android:resource"