• 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); }

    问题解决

  • 相关阅读:
    BitTorrent Sync 基于BT的文件同步
    转载:安装Ubuntu 15.10后要做的事
    VMware 虚拟机安装OSX el capitan 11.12
    GitStack 第三方开源服务器端
    一些不错的设计网站
    Spark注册UDF函数,用于DataFrame DSL or SQL
    R和Tableau平行坐标图
    Scala断言
    Spark Gradient-boosted trees (GBTs)梯度提升树
    Spark Multilayer perceptron classifier (MLPC)多层感知器分类器
  • 原文地址:https://www.cnblogs.com/lby0715/p/8981236.html
Copyright © 2020-2023  润新知