Questions tagged [android-fileprovider]

FileProvider is an extension of Android's ContentProvder class, which supports easy sharing of private files between apps.

FileProvider supports easy sharing of private files between Android apps. When paired with features like grantUriPermission(String, Uri, int) or FLAG_GRANT_READ_URI_PERMISSION, this provider ensures that receiving apps can always open the underlying file.

Apps should generally avoid sending raw filesystem paths across process boundaries, since the receiving app may not have the same access as the sender. Instead, apps should send Uri backed by a provider like FileProvider.

Resources:

679 questions
400
votes
35 answers

FileProvider - IllegalArgumentException: Failed to find configured root

I'm trying to take a picture with camera, but I'm getting the following error: FATAL EXCEPTION: main Process: com.example.marek.myapplication, PID: 6747 java.lang.IllegalArgumentException: Failed to find configured root that contains…
Pivoman
  • 4,435
  • 5
  • 18
  • 30
168
votes
10 answers

How to use support FileProvider for sharing content to other apps?

I'm looking for a way to correctly share (not OPEN) an internal file with external application using Android Support library's FileProvider. Following the example on the docs,
93
votes
5 answers

Android install apk with Intent.VIEW_ACTION not working with File provider

My app has an auto-update feature that download an APK and when the download is finished that a Intent.VIEW_ACTION to open the app and let the user install the downloaded apk Uri uri = Uri.parse("file://" + destination); Intent install = new…
89
votes
17 answers

Couldn't find meta-data for provider with authority

I have integrated Snapchat's Creative Kit in my Android app. After processing, I receive an image from the server in the form of Byte Array which I am saving to the disk and then sending the file to the Snapchat's Creative Kit as shown below. …
Mehul Kanzariya
  • 888
  • 3
  • 27
  • 58
72
votes
12 answers

Android - file provider - permission denial

I have two apps : app1 and app2. App2 has :
Jake
  • 16,329
  • 50
  • 126
  • 202
57
votes
10 answers

android.support.v4.content.FileProvider not found

I am trying to upgrade a working old app to support Android API 26, and one of the thing I need to use is android.support.v4.content.FileProvider - but it was not found.
Lim Thye Chean
  • 8,704
  • 9
  • 49
  • 88
53
votes
4 answers

Permission Denial while sharing file with FileProvider

I am trying to share file with FileProvider. I checked that file is shared properly with apps like Gmail, Google Drive etc. Even though following exception is thrown: 2019-08-28 11:43:03.169 12573-12595/com.example.name E/DatabaseUtils: Writing…
48
votes
2 answers

FileProvider Not Working with Camera

I'm trying to make Camera App to store the output to my internal storage. I also understand that third party apps are not able to access the Internal Storage of my application BUT we are able to do so by exposing the internal directory through…
You Qi
  • 8,353
  • 8
  • 50
  • 68
48
votes
3 answers

Android: FileProvider IllegalArgumentException Failed to find configured root that contains /data/data/**/files/Videos/final.mp4

I am trying to use FileProvider to play a video from private path.Facing java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/XXXXX(Package)/files/Videos/final.mp4 Code:
NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
47
votes
8 answers

Implementing a File Picker in Android and copying the selected file to another location

I'm trying to implement a File Picker in my Android project. What I've been able to do so far is : Intent chooseFile; Intent intent; chooseFile = new Intent(Intent.ACTION_GET_CONTENT); chooseFile.setType("*/*"); intent =…
42
votes
4 answers

FileProvider getUriForFile() error on Huawei devices

I have an exception that happens only on Huawei devices in my app when using FileProvider.getUriForFile: Exception: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage//Android/data/
guillaume-tgl
  • 2,749
  • 3
  • 23
  • 30
30
votes
2 answers

Android FileProvider for CACHE DIR : Failed to find configured root that contains

I found so many links which is related to FileProvider, but I didn't found solution for cache directory java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/pkg name/cache/1487876607264.png I want to use…
26
votes
4 answers

D/skia: --- Failed to create image decoder with message 'unimplemented'

i am using https://github.com/jhansireddy/AndroidScannerDemo this scan library in my project. when i capture image i am getting D/skia: --- Failed to create image decoder with message 'unimplemented' in console and The captured image not sets to…
26
votes
3 answers

FileProvider throws exception on GetUriForFile

I followed the example code on the android developer reference on FileProviders but it won't work. I have setup the path files/exports/ in the file provider definition in my Manifest and the referenced files does exist at that path. In my…
codingFriend1
  • 6,487
  • 6
  • 45
  • 67
22
votes
8 answers

Android : FileProvider on custom external storage folder

I'm trying to set up a fileprovider for sharing file. My files are saved in a folder "AppName" in the external storage (same level as Android, Movies and Pictures folders). Here is my file provider config :
budgw
  • 710
  • 1
  • 5
  • 13
1
2 3
45 46