嗨,我正在尝试使用此库中的https://github.com/Swati4star/Images-to-PDF ImagesToPDF 函数。我已经添加了我的应用程序所需的所有类。
现在,在添加 ImagesToPDF 函数之前,我已经在我的应用程序中使用了 picasso。
现在添加它后,我收到以下错误:
java.lang.NoSuchMethodError: No static method with(Landroid/content/Context;)Lcom/squareup/picasso/Picasso; in class Lcom/squareup/picasso/Picasso; or its super classes (declaration of 'com.squareup.picasso.Picasso' appears in /data/app/com.example.onboardingversion2-sJCkixxNOR2KPNLmYYdvpQ==/base.apk!classes2.dex)
在以下功能中出现错误:
/**
* Opens Matisse activity to select Images
*/
private void selectImages() {
Matisse.from(this)
.choose(MimeType.ofImage(), false)
.countable(true)
.capture(true)
.captureStrategy(new CaptureStrategy(true, AUTHORITY_APP))
.maxSelectable(1000)
.imageEngine(new PicassoEngine())
.forResult(INTENT_REQUEST_GET_IMAGES);
}
应用程序崩溃并给出错误。我添加了应用程序并设置了 Multidex
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
}
我还在 gradle 中添加了 multidexEnabled true。仍然抛出错误。请帮忙。谢谢你。