• java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider


    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/***.apk"],nativeLibraryDirectories=[/data/app-lib/***-1, /vendor/lib, /system/lib]]
                                                           at android.app.ActivityThread.installProvider(ActivityThread.java:4892)
                                                           at android.app.ActivityThread.installContentProviders(ActivityThread.java:4484)
                                                           at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4424)
                                                           at android.app.ActivityThread.access$1500(ActivityThread.java:143)
                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                           at android.os.Looper.loop(Looper.java:136)
                                                           at android.app.ActivityThread.main(ActivityThread.java:5120)
                                                           at java.lang.reflect.Method.invokeNative(Native Method)
                                                           at java.lang.reflect.Method.invoke(Method.java:515)
                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:818)
                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
                                                           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/***-1.apk"],nativeLibraryDirectories=[/data/app-lib/***-1, /vendor/lib, /system/lib]]
                                                           at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                           at android.app.ActivityThread.installProvider(ActivityThread.java:4877)
                                                           at android.app.ActivityThread.installContentProviders(ActivityThread.java:4484) 
                                                           at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4424) 
                                                           at android.app.ActivityThread.access$1500(ActivityThread.java:143) 
                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269) 
                                                           at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                           at android.os.Looper.loop(Looper.java:136) 
                                                           at android.app.ActivityThread.main(ActivityThread.java:5120) 
                                                           at java.lang.reflect.Method.invokeNative(Native Method) 
    

      


    1)首先修改Gradle配置文件,启用MultiDex并包含MultiDex支持:
    defaultConfig { multiDexEnabled true }

    在Application中重写attachBaseContext方法
    @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(base); }

    问题解决

  • 相关阅读:
    intellij idea 将taskRequest.java文件识别为文本文档
    react 学习笔记2
    react 学习笔记1
    webpack4 配置笔记(转自掘金)
    音乐播放之进度条-自定义
    EBS
    Python 学习笔记
    Form 电子表格(JTF GRID)
    Form 中实现历史记录查询
    Form 去掉使用格式掩码带来的多余字符
  • 原文地址:https://www.cnblogs.com/lby0715/p/8981236.html
Copyright © 2020-2023  润新知