zoukankan      html  css  js  c++  java
  • 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); }

    问题解决

  • 相关阅读:
    一本通1590恨 7 不成妻
    一本通1591数字计数
    一本通1589不要 62
    一本通1588数字游戏
    一本通1587【例 3】Windy 数
    一本通1586【 例 2】数字游戏
    一本通1585【例 1】Amount of Degrees
    一本通1584骑士
    一本通1583叶子的染色
    一本通1581旅游规划
  • 原文地址:https://www.cnblogs.com/lby0715/p/8981236.html
Copyright © 2011-2022 走看看