Skip to content

CameraX Basic - Task is rejected from java.util.concurrent.ThreadPoolExecutor(RejectedExecutionException)) #180

@haihuynhrdf

Description

@haihuynhrdf

Hi,
I have installed CameraXBasic without any modification on my phone (Galaxy J8).
I got this issue by following these steps:

  1. Open the app
  2. Take some pictures(press on the take picture button several times)
  3. Click on the preview button to navigate to the preview fragment
  4. Back to the camera fragment and click on the take picture button again
    -> I got the issue

I'm wondering if we should recreate cameraExecutor again, because we already cameraExecutor.shutdown() onDestroyView().
Could you please tell me? Thank you very much

Here the logcat is:

E/AndroidRuntime: FATAL EXCEPTION: CameraX-camerax_io_1 Process: com.android.example.cameraxbasic, PID: 26019 java.util.concurrent.RejectedExecutionException: Task androidx.camera.core.-$$Lambda$ImageSaver$S9mrYGMPcUwPIjUa0oK9HMzbx_o@5538a64 rejected from java.util.concurrent.ThreadPoolExecutor@5c03f59[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 188] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2085) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394) at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:631) at androidx.camera.core.ImageSaver.postSuccess(ImageSaver.java:240) at androidx.camera.core.ImageSaver.run(ImageSaver.java:182) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions