Skip to content
Sandny Blog
  • Home
  • Java
  • JavaScript
  • AWS
  • Embedded
  • About
androidx fileprovider android

AndroidX ClassNotFound Exception: “android.support. v4.content .FileProvider”

  • December 19, 2019December 23, 2019
  • by Coder Kai

This was an issue that was occurring after the migrating with new Androidx migration. The root cause was the android.support.v4.content.FileProvider was not provided in the latest android support library.

To debug this error you will have to see the adb log with the command

adb logcat

The issue will be visible for you as following in the log

12-19 09:29:21.936 20340 20340 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on
path: DexPathList[[zip file "/data/app/com.foo-ZEEUwKWVlwMF6G0KnwUxrA==/base.apk"],nativeLibraryDirectories=[/data/app/com.foo-ZEEUwKWVlwMF6G0KnwUxrA==/lib/x86, /data/app/com.foo-ZEEUwKWVlwMF6G0KnwUxrA==/base.apk!/lib/x8
6, /system/lib]]
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:6396)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread.access$1100(ActivityThread.java:199)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:193)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:6669)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
12-19 09:29:21.936 20340 20340 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

You can get around this issue by finding the relevant code line from the AndroidManifest.xml file

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

First, comment out this and see whether that error is gone from your app. Then if it’s good, you can remove it forever and run the project.

Checkout following on how to setup FCM push notifications with react native app.

How to setup FCM Push Notification with React Native App
02. Javascript Guide – Numbers
JDK 14 – The new features in Java 14
Coder Kai
A humble developer
adb android.support.v4.content.FileProvider" AndroidManifest.xml androidx FileProvider not starting

Related articles

Minimum supported Gradle Version
Minimum supported Gradle version is…
debounce with react hooks
Avoid multiple clicks using debounce…
react-native heap limit allocation
Android/iOS React-native heap limit allocation…
FCM Push Notification with React Native
How to setup FCM Push…

Categories

  • android 3
  • Apollo Client 1
  • AWS 8
    • AppSync 5
    • EC2 1
    • EKS 1
    • Route53 1
    • S3 1
  • AWS Amplify 1
  • Chakra UI 1
  • Docker 1
  • Embedded 1
  • EmberJS 1
  • FCM 1
  • Godaddy 1
  • GraphQL 3
  • ios 1
  • Jasper 1
  • Java 10
    • Java 11 1
    • Java 14 1
  • JavaEE 2
  • JavaScript 39
    • Express.js 4
    • Javascript Guide 7
    • Node.js 3
    • react-native 4
    • React.js 17
    • Typescript 1
  • Kubernetes 1
  • machine learning 1
  • Maven 2
  • OCaml 3
  • PostgreSQL 1
  • Python 2
  • react-native 4
  • ReactJS 3
  • sass 1
  • Server 6
  • spark 1
  • Terraform 2
  • Ubuntu 4
  • Uncategorized 1
  • webpack 2

Recent Comments

  • binance signup on How to use Typescript with arrays
  • LewisLousA on Add SASS in webpack React Redux project
  • melnhnmzy on Higher order component wrappers using React.js and reusable components.

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • October 2022 3
  • September 2022 7
  • May 2022 1
  • December 2021 1
  • August 2021 1
  • July 2021 6
  • June 2021 3
  • February 2021 1
  • July 2020 1
  • December 2019 5
  • November 2019 6
  • October 2019 3
  • August 2019 1
  • March 2019 1
  • February 2019 1
  • January 2019 2
  • December 2018 1
  • September 2018 2
  • August 2018 1
  • June 2018 1
  • February 2018 1
  • November 2017 2
  • October 2017 5
  • September 2017 1
  • June 2017 1
  • May 2017 10
Sandny Blog space
Theme by Colorlib Powered by WordPress