I encounter this problem only on lollipop version. I can run the app easily on versions above lollipop. The error shows up when I run the app in my application file:
If you are using fabric then please remove dependency of picasso from gradle, it will work fine.Try it...
If publishNonDefault true
was defined in libs build.gradle, please remove it or make it false. Please try. I have resolved this issue by removing publishNonDefault true
in build.gradle of lib which occurred NoClassDefFoundError
.
If not working, please add
dexOptions {
preDexLibraries false
}
.
You need to install Multidex
to run picasso
on lower devices
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
}
add this in your manifest
under application
tag
android:name="your.package.name.MyApplication"