Only on Lollipop: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/picasso/Picasso;

后端 未结 3 1765
忘掉有多难
忘掉有多难 2021-01-15 07:47

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:

相关标签:
3条回答
  • 2021-01-15 08:14

    If you are using fabric then please remove dependency of picasso from gradle, it will work fine.Try it...

    0 讨论(0)
  • 2021-01-15 08:18

    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 }.

    0 讨论(0)
  • 2021-01-15 08:27

    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"
    
    0 讨论(0)
提交回复
热议问题