Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File provider is preventing the app from launching on earlier Android versions #693

Closed
ross-holloway94 opened this issue Feb 6, 2018 · 7 comments
Labels
bug Produces incorrect or unexpected result or behaviour.

Comments

@ross-holloway94
Copy link
Contributor

ross-holloway94 commented Feb 6, 2018

Tested on APIs 16 and 18.
From what I can understand, "FileProvider" has been added to the EasyImage library which is causing this problem.

02-02 10:25:04.525 3597-3597/openfoodfacts.github.scrachx.openfood E/AndroidRuntime: FATAL EXCEPTION: main
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/openfoodfacts.github.scrachx.openfood-2.apk"],nativeLibraryDirectories=[/data/app-lib/openfoodfacts.github.scrachx.openfood-2, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:4882)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList[[zip file "/data/app/openfoodfacts.github.scrachx.openfood-2.apk"],nativeLibraryDirectories=[/data/app-lib/openfoodfacts.github.scrachx.openfood-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.installProvider(ActivityThread.java:4867)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425) 
at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:137) 
at android.app.ActivityThread.main(ActivityThread.java:5103) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
at dalvik.system.NativeStart.main(Native Method) 
@ross-holloway94 ross-holloway94 added the bug Produces incorrect or unexpected result or behaviour. label Feb 6, 2018
@jaztriumph
Copy link
Contributor

I wish to work on this.

@sowmya9029
Copy link
Contributor

sowmya9029 commented Feb 16, 2018

This issue still exists.I am unable to proceed forward due to this.
I am running on API version : 23. Can you please let me know if there is a known fix for this.

@jaztriumph
Copy link
Contributor

jaztriumph commented Feb 16, 2018

@sowmya9029 You are experiencing this issue while the app is opening right?
I have fixed this in #749.

@ross-holloway94
Copy link
Contributor Author

This issue can be closed. Cannot see how to do it on Fasthub though.

@ozanhonamlioglu
Copy link

ozanhonamlioglu commented Jul 25, 2019

Hi

Please follow the build error and see what is crushes. In my case I changed every "android.aaa.bbb.ccc" which is incompatible or old libraries with "androidx.aaa.bbb.ccc". To see androidx version libraries search for google, you can find them in android's web page.

In my case changing those libraries removed all build fails but it was not enough for me because when I tried to run my app on device then it gave me "android.support.v4.content.FileProvider" this error. I was changed all of my android.support.v4.content.FileProvider libraries with the new androidx.core.content.FileProvider but what was crushing now ? even while building gives no any error.

Finally I figured out it, I just needed to change one library with new version too and here is steps:

Click to AndroidManifest.xml look at the bottom of the files page you gonna see "Text" and "Merged Manifes" then click to "Merged Manifest" -> Search for "android.support.v4.content.FileProvider" then change it with "androidx.core.content.FileProvider"

Now you should get to go without any error.

@VaiTon
Copy link
Member

VaiTon commented Jul 23, 2020

Now that we've migrated to androidx this should be fixed. Feel free to reopen/comment for reopening.

@VaiTon VaiTon closed this as completed Jul 23, 2020
@Sanjay-Xamarin
Copy link

am getting this exception after migrate to AndroidX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Produces incorrect or unexpected result or behaviour.
Projects
None yet
Development

No branches or pull requests

6 participants