LuckSiege / LuckSiege/PictureSelector

类型转换异常

Open
#2,600 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## Current use version?
#### 当前使用的版本是多少?

```
v3.10.7
```

## Will this problem occur in demo?
#### Demo能否复现这问题?

```
不能,线上小概率事件
```

## Describe the problem or provide an error log?
#### 描述问题或提供错误log?

```
java.lang.RuntimeException:Unable to destroy activity {com.xxx/com.luck.picture.lib.basic.PictureSelectorTransparentActivity}: java.lang.ClassCastException: com.xxx.widgets.IjkPlayerView cannot be cast to com.luck.picture.lib.widget.MediaPlayerView
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:6093)
......
Caused by:
java.lang.ClassCastException:com.xxx.widgets.IjkPlayerView cannot be cast to com.luck.picture.lib.widget.MediaPlayerView
com.luck.picture.lib.engine.MediaPlayerEngine.destroy(MediaPlayerEngine.java:19)
com.luck.picture.lib.adapter.holder.PreviewVideoHolder.releaseVideo(PreviewVideoHolder.java:286)
com.luck.picture.lib.adapter.PicturePreviewAdapter.destroy(PicturePreviewAdapter.java:170)
com.luck.picture.lib.PictureSelectorPreviewFragment.onDestroy(PictureSelectorPreviewFragment.java:1669)
androidx.fragment.app.Fragment.performDestroy(Fragment.java:3356)
androidx.fragment.app.FragmentStateManager.destroy(FragmentStateManager.java:781)
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack-trace path in MediaPlayerEngine.java, then inspect releaseVideo in PreviewVideoHolder.java and destroy in PicturePreviewAdapter.java. Determine why IjkPlayerView is being treated as MediaPlayerView during activity destruction, and verify the fix against the reported lifecycle failure; the payload provides no reproducible test or named test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.