项目在android 6.0机器运行正常,换了华为手机Android4.4.4,报下列异常java.lang.RuntimeException: Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider"
经一番网络查找,改正后,运行正常,现记录一下,以备以后项目纠错:
在项目app/build.gradle下添加:
defaultConfig{multiDexEnabled true}
在自定义的Application中添加
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
网友评论