java.lang.RuntimeException: Unable to get provider com.lzy.imagepicker.ImagePickerProvider: java.lan

java.lang.RuntimeException: Unable to get provider com.lzy.imagepicker.ImagePickerProvider: java.lang.ClassNotFoundException: Didn't find class "com.lzy.imagepicker.ImagePickerProvider" on path: DexPathList[[zip file "/data/app/XX.XX.XX.apk"],nativeLibraryDirectories=[/data/app-lib/XX.XX.XX, /vendor/lib, /system/lib]] 


在5.++以上不报错,但是4.++报错

解决办法,经查阅资料得知
依赖分包库

implementation 'com.android.support:multidex:1.0.0'
和复写加粗方法
public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        JPushInterface.init(this);
        JPushInterface.setDebugMode(true);

        // 蒲公英内存更新
        PgyCrashManager.register(getApplicationContext());

        // 打印
        Logger.addLogAdapter(new AndroidLogAdapter() {
            @Override public boolean isLoggable(int priority, String tag) {
//                return BuildConfig.DEBUG;
                return true;
            }
        });

    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}


你可能感兴趣的:(Android)