ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" after androidx migration

Solution 1:

Thanks to @CommonsWare

More explanation:

What to do, find the android.support.v4.FileProvider in your <provider> in AndroidManifest.xml.

Change it to androidx.core.content.FileProvider

Solution 2:

In manifiest.xml file simply change this

<provider
        android:name="android.support.v4.content.FileProvider"
      .....
</provider>

To this one

<provider
    android:name="androidx.core.content.FileProvider"
    ......
</provider>

Or Simply

  • Go to Refactor (Studio -> Menu -> Refactor)
  • Click the Migrate to AndroidX.
  • it's working.