Android FileProvider class not found in release builds

didn t find class android support v4 content fileprovider android
android fileprovider external storage
missing android support file_provider_paths meta-data
unable to get provider com imagepicker fileprovider
error: package android support multidex does not exist
unresolved class fileprovider
runtimeexception unable to get provider androidx core content fileprovider
androidx support library

I'm using a FileProvider to get photos from the device. The implementation works just fine in debug builds (minifyEnabled false) but when I'm building the release build (minifyEnabled true) I get an error:

java.lang.RuntimeException: Unable to get provider 
java.lang.ClassNotFoundException: Didn't find class "" 
on path: DexPathList[[zip file "/data/app/"],
nativeLibraryDirectories=[/data/app/, /vendor/lib, /system/lib]]

So I guess this has someting to do with the proguard setup

I have

compile ''

which is a superset of v4 in my gradle file and

minSdkVersion 21
targetSdkVersion 23


-keep class** { *; }
-keep class** { *; }
-keep interface** { *; }
-keep interface** { *; }
-keep class * extends android.content.ContentProvider

in my file

I have tested with both Android 5 and 6 and same thing happens. Any suggestion would be usefull, thanks in advance.

I was using androidx library and getting the same error. So, in AndroidManifest.xml, I changed this line:


to this:


proguard, I am using FileProvider in my app. As usual FileProvider class not found in android Kitkat android { buildTypes { release { multiDexKeepFile file('multidex-​config.txt') . The Android build tools construct a primary DEX file (classes.dex) and  * Resgen * Permissions may need to be checked to control functionality * The Android FileProvider now can detect permissions - internal / external storage can be controlled - KitKat+ does not require the permissions - corrected the FileProvider resource xml * Added support for email attachments - support for a string path and native file types

The following worked for me:

In your module build.gradle file:

defaultConfig {
multiDexEnabled true



dependencies {
compile ''


And finally, ensure that your application class has one of the following:

A. If you do not extend your application class:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
            android:name="" >
</manifest> class not found in android , i'm using fileprovider photos device. implementation works fine in debug builds (​minifyenabled false) when i'm building release build  @matt-oakes Nope, none of my dependencies is using AndroidX. I just had in my build.gradle Google Services with '+' version, which means the last one. 17 June Google announced new major release which broke my app.

After a couple of hours of more googling around I've ended up updating gradle and google services to

dependencies {
    classpath ''
    classpath ''

previously the version ware

    classpath ''
    classpath ''

I guess there needs to be something with the google-services library

Recent Support Library Revisions, android { buildTypes { release { multiDexKeepFile file('multidex-config.txt') } } } Note : You can add it for specific build type or both by declaring it in defaultConfig​  When an app wants to access a file shared by another app, the requesting app (the client) usually sends a request to the app sharing the files (the server).

Gradle tips and recipes, This is the stable release of Support Library 28.0.0 and is suitable for use in production. which throw an IllegalArgumentException when the target cannot be found. FileProvider now supports getExternalMediaDirs() on API 21 and higher does not clear its Loaders in onCleared; Class file for android.arch.​lifecycle. Instrumented unit tests are tests that run on physical devices and emulators, and they can take advantage of the Android framework APIs and supporting APIs, such as AndroidX Test. Instrumented tests provide more fidelity than local unit tests, but they run much more slowly.

Class androidx.core.content.FileProvider, If you want to learn about ways to make your builds faster, read Optimize Your Build This block encapsulates custom properties and makes them available to all Specifies a list of screen densities Gradle should not create APKs for. release {} } // Specifies the flavor dimensions you want to use. The order in which you In Android, build-name is used as versionName while build-number used as versionCode. For more information, see Version your app in the Android documentation. After updating the version number in the pubspec file, run flutter pub get from the top of the project, or use the Pub get button in your IDE.

ClassNotFoundException: Didn't find class " , These permissions are available to the client app for as long as the stack for a Set the android:exported attribute to false ; the FileProvider does not need to be public. encodedPath(path).build(); } @Override public File getFileForUri(Uri uri)​  Open "AndroidManifest.template.xml" inside the folder of your project and set android:minSdkVersion="14" and android:targetSdkVersion="26". Set Release mode on Build Configurations. (In Debug mode will not appear the permission box, only in Release mode) <

  • Have a look at this link. It might help you.
  • Check this out
  • Hello @Munier Parker, I have done all these but still getting same issue.
  • What does have to do with