Elad Benda2
Elad Benda2

Reputation: 15482

java.lang.NoClassDefFoundError: com.squareup.picasso.Picasso

I try to use Picasso for the first time

like in the official site example:

private void setItemBgImageUsingPicasso(View convertView) {
    String imageUrl = getImageUrlFromOffer(convertView);

    ImageView offerImage = ((ImageView) convertView
            .findViewById(R.id.offerImage));
    Picasso.with(mOffersListActivity).load(imageUrl).into(offerImage);
}

but I get this error:

08-09 17:37:43.309: E/AndroidRuntime(17821): java.lang.NoClassDefFoundError: com.squareup.picasso.Picasso
08-09 17:37:43.309: E/AndroidRuntime(17821):    at com.zoomer.general.ImageAdapter.setItemBgImageUsingPicasso(ImageAdapter.java:384)

Upvotes: 2

Views: 4160

Answers (2)

Bobby
Bobby

Reputation: 6940

if using Android Studio, I found the problem to be related to proguard so, the following fixed the issue:

1) Add this to your proguard-rules file: -keep class com.squareup.picasso.** { *; }

2) Clean the project

3) Re-build

Upvotes: 2

A23149577
A23149577

Reputation: 2145

You should put it in libs folder and Eclipse will pack it properly for you.

Or you leave it as it is, but go to project properties, Export tab and check the library. This way Eclipse will pack it in the final APK.

Upvotes: 3

Related Questions