qingmei2 / RxImagePicker

:rocket:RxJava2 and RxJava3 external support. Android flexible picture selector, provides the support for theme of Zhihu and WeChat (灵活的Android图片选择器,提供了知乎和微信主题的支持).
MIT License
1.2k stars 155 forks source link

同样遇到了cursor.getString(xxxxx)must not be null 此bug,错误日志如下 #67

Closed diswy closed 5 years ago

diswy commented 5 years ago

2019-07-11 11:29:05.537 13238-13238/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.cqebd.interact.class, PID: 13238 java.lang.IllegalStateException: cursor.getString(cursor.….MediaColumns.MIME_TYPE)) must not be null at com.qingmei2.rximagepicker_extension.entity.Item$Companion.valueOf(Item.kt:137) at com.qingmei2.rximagepicker_extension.ui.adapter.AlbumMediaAdapter.getItemViewType(AlbumMediaAdapter.kt:180) at com.qingmei2.rximagepicker_extension.ui.adapter.RecyclerViewCursorAdapter.getItemViewType(RecyclerViewCursorAdapter.kt:52) at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5926) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858) at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854) at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230) at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:557) at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517) at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612) at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:171) at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924) at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641) at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585) at android.widget.LinearLayout.onLayout(LinearLayout.java:1494) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:727) at android.view.View.layout(View.java:17653) at android.view.ViewGroup.layout(ViewGroup.java:5575) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2346) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2068)

补充描述:参考使用得zhihu 图片选择器,之前用着好好的,不知道为啥,突然调用就一直崩溃出现上面的日志。

diswy commented 5 years ago

补充说明:更换了别的机器同样代码是正常的,然后对出现问题的机器进行了重新刷机。再次安装这次又正常了

qingmei2 commented 5 years ago

@diswy

谢谢你的反馈,请问依赖的库的版本是多少?

qingmei2 commented 5 years ago

该issue和 #55 相同,因此合并为一个issue进行观察。

qingmei2 commented 5 years ago

虽然无法复现,但是代码崩溃原因找到了:

https://stackoverflow.com/questions/45688232/illegalstateexception-parcel-readstring-must-not-be-null

代码已经进行提交,该bug将很快在3.x和2.x版本上发布两个修复版本。

diswy commented 5 years ago

感谢作者的修复,最近实在太忙没来得及回复