I keep on getting the NoClassDefFoundError
on other test device (4.4.2) that I\'m using. But works fine on my test device (Android 5.1).
I tried the solutio
Thanks to TapanHP above I got this working quickly for me:
Short Answer:
I had multiDexEnabled= true
set in my app/build.gradle
file and this ran fine on Android 5.x.x above but any test device with 4.x.x (kit kat) would throw a critical error "Unfortunately, YourAppName has stopped."
Debugger showed:
Could not find class 'com.google.firebase.FirebaseOptions' ....
Note: I also have a custom class that extends Application
.
My Solution: Added the following code to my custom Application class
import android.support.multidex.MultiDex;
public class YourCustomApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
...
}
No more critical crash.