LuckSiege / LuckSiege/PictureSelector
Vivo手机打开拍照奔溃【You need to use a Theme.AppCompat theme (or descendant) with this activity. com.luck.picture.lib.PictureBaseActivity.onCreate(PictureBaseActivity.java:179)】
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
**java.lang.RuntimeException:Unable to start activity ComponentInfo{com.timemicrotech.miaozou/com.luck.picture.lib.PictureSelectorCameraEmptyActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.**
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2728)
......
Caused by:
java.lang.IllegalStateException:You need to use a Theme.AppCompat theme (or descendant) with this activity.
androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:846)
androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809)
androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
com.luck.picture.lib.PictureBaseActivity.onCreate(PictureBaseActivity.java:179)
com.luck.picture.lib.PictureSelectorCameraEmptyActivity.onCreate(Native Method)
android.app.Activity.performCreate(Activity.java:6859)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
android.app.ActivityThread.-wrap12(ActivityThread.java)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1513)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:154)
android.app.ActivityThread.main(ActivityThread.java:6211)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:793)
调用方法
```
PictureSelector.create(view.context as Activity)
.openCamera(PictureMimeType.ofImage())
.imageEngine(GlideEngine.getInstance())
.isCompress(true)
.compressQuality(30)
.maxSelectNum(1)
.isCamera(true)
.isCameraAroundState(true)
.setButtonFeatures(CustomCameraView.BUTTON_STATE_ONLY_CAPTURE)
.isWeChatStyle(true)
.forResult(object : OnResultCallbackListener {
override fun onResult(result: List) {
.......
}
override fun onCancel() {
......
}
})
```
开源库的版本是2.5.8
现在出现问题的全是vivo手机,安卓高低版本都有,决大多数在7-11之间,10,11又占这部分的大部分
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at PictureBaseActivity.java:179 and trace the camera flow through PictureSelectorCameraEmptyActivity. Reproduce the crash using the shown openCamera call on affected Vivo devices and inspect the activity theme requirements. Done means camera launch no longer throws the AppCompat theme exception on the reported Android versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100