LuckSiege / LuckSiege/PictureSelector

今天收集到一个关于camera-camera2的bug

Open
#2,017 7 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

错误摘要
java.lang.IllegalStateException
CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2'.
com.luck.picture.lib.camera.CustomCameraView.initView(CustomCameraView.java:128)

Log:

Process Name: 'com.wyp.englisharticle'
Thread Name: 'main'
Back traces starts.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wyp.englisharticle/com.luck.picture.lib.PictureCustomCameraActivity}: java.lang.IllegalStateException: CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2'.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3877)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4056)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2464)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8299)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1052)
Caused by: java.lang.IllegalStateException: CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2'.
at androidx.camera.core.CameraX.getOrCreateInstance(CameraX.java:373)
at androidx.camera.lifecycle.ProcessCameraProvider.getInstance(ProcessCameraProvider.java:153)
at androidx.camera.view.CameraController.(CameraController.java:230)
at androidx.camera.view.LifecycleCameraController.(LifecycleCameraController.java:71)
at com.luck.picture.lib.camera.CustomCameraView.initView(CustomCameraView.java:128)
at com.luck.picture.lib.camera.CustomCameraView.(CustomCameraView.java:104)
at com.luck.picture.lib.PictureCustomCameraActivity.createCameraView(PictureCustomCameraActivity.java:89)
at com.luck.picture.lib.PictureCustomCameraActivity.onCreate(PictureCustomCameraActivity.java:73)
at android.app.Activity.performCreate(Activity.java:8085)
at android.app.Activity.performCreate(Activity.java:8073)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1320)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3850)
... 11 more
Back traces ends.

设备信息:
设备机型:HUAWEI
是否Root:是
机型版本:LIO-AL00
设备电量:100
电池温度:280
磁盘可用占比:72.34
内存可用占比:29.17
SD卡可用占比:
--
CPU架构:
arm64-v8a,armeabi-v7a,armeabi
umid:
4dabae12ab74c71dff3a3377bdd208ddod
使用时长(s):
5.00
前后台状态:
网络类型:
unknown

系统:
android
系统版本:10

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 CustomCameraView.initView at CustomCameraView.java:128 and the CameraX stack trace, then inspect PictureCustomCameraActivity.createCameraView. Reproduce the crash on the reported Android 10 device or a comparable setup and check the project's CameraX dependencies, including camera-camera2. Done means the custom camera activity initializes without this IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.