close

[Solved] error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider

Hello Guys, How are you all? Hope You all Are Fine. Today I am Just updated Android API 26 And Now, I am facing following error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider Error Occurs ?

I am Just updated Android API 26 And Now, I am facing following error.

error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;

How To Solve error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider Error ?

  1. How To Solve error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider Error ?

    To Solve error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider Error You Just need to update provider tag in your menifest File. Now, Your error must be solved. Second solution is Instead of This import android.support.v4.content.FileProvider; Try importing like this: import androidx.core.content.FileProvider; Now, Your error will be fixed.

  2. error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider

    To Solve error: package android.support.v4.content does not exist import android.support.v4.content.FileProvider Error You Just need to update provider tag in your menifest File. Now, Your error must be solved. Second solution is Instead of This import android.support.v4.content.FileProvider; Try importing like this: import androidx.core.content.FileProvider; Now, Your error will be fixed.

Solution 1: Update provider tag in menifest

You Just need to update provider tag in your menifest File.

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>

Now, Your error must be solved.

Solution 2: Try to importing like this

Instead of This

import android.support.v4.content.FileProvider;

Try importing like this.

import androidx.core.content.FileProvider;

Solution 3: Add This line in build.gradle

Just add this line in your build.gradle.

compile 'com.android.support:support-v4:26.1.0'

Solution 4: Run this command

npm install jetifier --save
npx jetify
npx cap sync

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment