Skip to content Skip to sidebar Skip to footer

Android.support.v4.content.fileprovider Class Not Found In Android Kitkat

I am using FileProvider in my app. As usual I declared tag in AndroidManifest.xml file as below.

before android 5.0, you must use follow ways to multidex:

android {
defaultConfig {
    ...
    minSdkVersion 15
    targetSdkVersion 28
    multiDexEnabled true
}
...
}

dependencies {
  compile 'com.android.support:multidex:1.0.3'
}

and then modify application, select any one of three ways:

if you not implement application:

<?xml version="1.0" encoding="utf-8"?><manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.example.myapp"><applicationandroid:name="android.support.multidex.MultiDexApplication" >
        ...
    </application></manifest>

if you have custom application, you can modify like this:

publicclassMyApplicationextendsMultiDexApplication { ... }

if you have replace base application, you can modify like this:

publicclassMyApplicationextendsSomeOtherApplication {
   @OverrideprotectedvoidattachBaseContext(Context base) {
      super.attachBaseContext(base);
      MultiDex.install(this);
   }
}

Hope this can solve you problem.

Solution 3:

The following code works for me (I've migrated to AndroidX):

<providerandroid:name="androidx.core.content.FileProvider"android:authorities="${applicationId}.provider"android:exported="false"android:grantUriPermissions="true"tools:ignore="WrongManifestParent"><meta-dataandroid:name="android.support.FILE_PROVIDER_PATHS"android:resource="@xml/provider_paths" /></provider>

Solution 4:

in my project when set "multiDexEnabled" false, error fixed. go to manifest and add

android {

defaultConfig {
    multiDexEnabled false
}}

hope this is helpful

Solution 5:

Post a Comment for "Android.support.v4.content.fileprovider Class Not Found In Android Kitkat"