Skip to content

java.util.concurrent.RejectedExecutionException:  #128945

@Soliardi-Chyngyz

Description

@Soliardi-Chyngyz

Is there an existing issue for this?

Steps to reproduce

java.util.concurrent.RejectedExecutionException:

I use image picker inside of Bloc

Expected results

no issue

Actual results

Uncaught exception thrown by finalizer
E/System  (20675): java.util.concurrent.RejectedExecutionException: Task android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy$$ExternalSyntheticLambda2@b067cfb rejected from java.util.concurrent.ThreadPoolExecutor@f9e118[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 9]
E/System  (20675): 	at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
E/System  (20675): 	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
E/System  (20675): 	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1394)
E/System  (20675): 	at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:630)
E/System  (20675): 	at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.onClosed(CallbackProxies.java:104)
E/System  (20675): 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:588)
E/System  (20675): 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:879)
E/System  (20675): 	at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)
E/System  (20675): 	at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)
E/System  (20675): 	at java.lang.Daemons$Daemon.run(Daemons.java:139)
E/System  (20675): 	at java.lang.Thread.run(Thread.java:920)

Code sample

try {
      final xFile = await ImagePicker().pickImage(
        source: ImageSource.camera,
      );

      if (xFile == null) {
        return emit(state.copyWith(status: PhotoManagerStatus.close));
      }

      final pickedFileBodyBytes = await xFile.readAsBytes();
      final List<Uint8List> chosenImages = List<Uint8List>.from(state.chosenImages)
        ..add(pickedFileBodyBytes);
      final List<String> chosenImagesPath = List<String>.from(state.chosenImagesPath)
        ..add(xFile.path);


      emit(state.copyWith(
        status: PhotoManagerStatus.pictureTaken,
        chosenImages: chosenImages,
        chosenImagesPath: chosenImagesPath,
      ));
    }

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions