Java.lang.NoClassDefFoundError specific reasons for this error reference https://blog.csdn.net/jamesjxin/article/details/46606307
In most projects, the main reason is being given too much dex is a method and quantity (more than 65,536) result in no reference in its entirety.
This method of problem solving:
1. gradle file, add
{defaultConfig
// Ignore other
multiDexEnabled to true
}
Dependencies {
// Ignore other
compile 'com.android.support:multidex:1.0.3'
}
2. APP class added in Application Method
@Override
protected void attachBaseContext (the Context Base) {
super.attachBaseContext (Base);
MultiDex.install (the this);
}
problem solving method exceeds the number of dex limit.
----------------
Disclaimer: This article is CSDN blogger "trq2012 'original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/trq2012/article/details/80492403