zhihu / Matisse

:fireworks: A well-designed local image and video selector for Android
Apache License 2.0
12.52k stars 2.06k forks source link

Failed resolution of: Lcom/squareup/picasso/Picasso; #342

Closed JamesZBL closed 6 years ago

JamesZBL commented 6 years ago

Process: com.a.b, PID: 20494 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/picasso/Picasso; at com.zhihu.matisse.engine.impl.PicassoEngine.loadThumbnail(PicassoEngine.java:34) at com.zhihu.matisse.internal.ui.widget.PhotoGrid.setImage(PhotoGrid.java:112) at com.zhihu.matisse.internal.ui.widget.PhotoGrid.bindPhoto(PhotoGrid.java:80) at com.zhihu.matisse.internal.ui.adapter.AlbumPhotosAdapter.onBindViewHolder(AlbumPhotosAdapter.java:111) at com.zhihu.matisse.internal.ui.adapter.RecyclerViewCursorAdapter.onBindViewHolder(RecyclerViewCursorAdapter.java:44) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6389) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5335) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5598) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224) at android.support.v7.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:556) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595) at android.support.v7.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.vie

hkhoshraftar commented 6 years ago

i have this error too

cutiko commented 6 years ago

It seems there is a conflict with the library versions, downgrading Picasso and using PicassoEngine fix it for me:

implementation 'com.squareup.picasso:picasso:2.5.2'
.imageEngine(new PicassoEngine())

Got the idea by looking at this https://github.com/zhihu/Matisse/blob/35f46b58a1ea1610fabf33cdf5a9fd0acc41d05d/matisse/build.gradle#L49

@JamesZBL @hkhoshraftar

REBOOTERS commented 6 years ago

https://github.com/zhihu/Matisse/wiki/Image-Engine

cutiko commented 6 years ago

Excuse me but why this is closed? The problem is related with the gradle configuration of the library. I can see 2 fixes: