Closed ahaneef29 closed 6 years ago
Solution is there too:
Suggestion: add 'tools:replace="android:resource"' to element at AndroidManifest.xml to override.
After that clean platform directory & try again. it should work.
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).
If possible try to use either nativescript-camera
plugin or this plugin.
where i should place this exactly in manifest . 'tools:replace="android:resource"' ?
Please reopen this issue , cause not fixed the problem
@haneef5k Please follow this one: https://stackoverflow.com/a/45025597/8875176
Or remove nativescript-camera
because this plugin is conflict here.
@nginx17 this problem isn't related with this plugin.
@haneef5k if you are following https://stackoverflow.com/a/45025597/8875176 then you may need to change
details.useVersion '25.3.0'
to details.useVersion '27.0.1'
The problem is happening because this plugin & nativescript-camera
both are using FileProvider
. So, during build it having problem to merge. I still recommend you to uninstall nativescript-camera
plugin before trying this one.
But @haneef5k you can look around. I just tried in a fresh project & build is working fine.
@jibon57 , @haneef5k
Add
<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>
under <application *** > Fix my problem
@nginx17, thank you! I am closing this issue.
Thank you @nginx17 and @jibon57
@all
If you use the solution above, it only removes errors during run / build. but when using nativescript-camera you will find new problems and I haven't found a solution to use these 2 plugins at once.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="14"
android:versionName="1.0.14"
xmlns:tools="http://schemas.android.com/tools">
<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>
</application>
</manifest>
it worked for me
These are not working for me
Manifest merger failed : Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from AndroidManifest.xml:54:11-45 is also present at [:nativescript_mediafilepicker:] AndroidManifest.xml:46:17-51 value=(@xml/file_paths). Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
AndroidManifest
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:launchMode="singleTask"
android:hardwareAccelerated="true"
android:windowSoftInputMode="stateHidden|adjustResize"
android:theme="@style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<provider android:authorities="com.facebook.app.FacebookContentProviderXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"
tools:replace="android:authorities"/>
<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>
13:37:24 - Compilation complete. Watching for file changes.
C:\projects\Real_App\platforms\android\app\src\main\AndroidManifest.xml:19:17-55 Error: 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 element at AndroidManifest.xml to override.
FAILURE: Build failed with an exception.