Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Issue in android manifest file #26

Closed
ahaneef29 opened this issue Sep 9, 2018 · 14 comments
Closed

Issue in android manifest file #26

ahaneef29 opened this issue Sep 9, 2018 · 14 comments

Comments

@ahaneef29
Copy link

13:37:24 - Compilation complete. Watching for file changes.

     + setting applicationId
     + applying user-defined configuration from C:\projects\Real_App\app\App_Resources\Android\app.gradle
     + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
     + adding aar plugin dependency: C:\projects\Real_App\node_modules\nativescript-camera\platforms\android\nativescript_camera.aar
     + adding aar plugin dependency: C:\projects\Real_App\node_modules\nativescript-mediafilepicker\platforms\android\MultiTypeFilePicker-release.aar
     + adding aar plugin dependency: C:\projects\Real_App\node_modules\nativescript-mediafilepicker\platforms\android\nativescript_mediafilepicker.aar
     + adding aar plugin dependency: C:\projects\Real_App\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar

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.

  • 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 element at AndroidManifest.xml to override.

@jibon57
Copy link
Owner

jibon57 commented Sep 9, 2018

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.

@jibon57 jibon57 closed this as completed Sep 9, 2018
@ahaneef29
Copy link
Author

where i should place this exactly in manifest . 'tools:replace="android:resource"' ?

@nginx17
Copy link

nginx17 commented Sep 10, 2018

Please reopen this issue , cause not fixed the problem

@jibon57
Copy link
Owner

jibon57 commented Sep 10, 2018

@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.

@jibon57
Copy link
Owner

jibon57 commented Sep 10, 2018

@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'

@jibon57 jibon57 reopened this Sep 10, 2018
@jibon57
Copy link
Owner

jibon57 commented Sep 10, 2018

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.

https://github.com/NativeScript/nativescript-camera/blob/3bd512e5d6e726884912cf889d6c64473c762d1a/src/platforms/android/AndroidManifest.xml#L5

https://github.com/fishwjy/MultiType-FilePicker/blob/fbbcdbde53c0c8795c754e90c6c5f6c620976e43/filepicker/src/main/AndroidManifest.xml#L32

But @haneef5k you can look around. I just tried in a fresh project & build is working fine.

@nginx17
Copy link

nginx17 commented Sep 10, 2018

@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
Copy link

nginx17 commented Sep 10, 2018

don't forget add

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

at <manifest

@jibon57
Copy link
Owner

jibon57 commented Sep 10, 2018

@nginx17, thank you! I am closing this issue.

@jibon57 jibon57 closed this as completed Sep 10, 2018
@ahaneef29
Copy link
Author

Thank you @nginx17 and @jibon57

@nginx17
Copy link

nginx17 commented Sep 11, 2018

@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.

@hariaravind10
Copy link

hariaravind10 commented Nov 12, 2018


  1. add this in manifest.xml

<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">

  1. add this

        <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

@asciidiego
Copy link

FYI See: #33

@csimpi
Copy link

csimpi commented Feb 12, 2022

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>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants