Android : app loading library at runtime on Lollipop but not IceCreamSandwich

后端 未结 4 676
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 11:10

I\'m currently developping an Android app using Android Studio. Currently, the app is launching perfectly on Lollipop devices, but crashes at launch due to a ClassNotF

4条回答
  •  伪装坚强ぢ
    2020-12-05 11:36

    On some low-end devices adding MultiDex.install(getBaseContext()); to MyApplication onCreate() did not work? causing java.lang.NoClassDefFoundError:

    What did work was adding MultiDex.install(getBaseContext());to MyApplication attachBaseContext(Context base)

    public class MyApplication extends Application {
    ...
       @Override
        protected void attachBaseContext(Context base) {
            super.attachBaseContext(base);
            MultiDex.install(base);
        }
    ...
    

提交回复
热议问题