Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes: FATAL EXCEPTION: pool-109-thread-1 (java.lang.IllegalArgumentException: Each request must have at least one Surface target) #139

Open
Venkat-polagani7 opened this issue Apr 26, 2024 · 0 comments

Comments

@Venkat-polagani7
Copy link

Venkat-polagani7 commented Apr 26, 2024

Hello @khoren93,

I have an issue encountering recently in this package when uploading the images from the ReaderWidget. When I continuously uploads the images from the gallery consequently 10~15 times, the app is being crashed and throwing the errors as shown below:

E/AndroidRuntime(13388): FATAL EXCEPTION: pool-109-thread-1
E/AndroidRuntime(13388): Process: com.example.projectCamera, PID: 13388
E/AndroidRuntime(13388): java.lang.IllegalArgumentException: Each request must have at least one Surface target
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:1293)
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CameraDeviceImpl.setRepeatingRequest(CameraDeviceImpl.java:1369)
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:332)
E/AndroidRuntime(13388): 	at io.flutter.plugins.camera.Camera.refreshPreviewCaptureSession(Camera.java:587)
E/AndroidRuntime(13388): 	at io.flutter.plugins.camera.Camera$2.onConfigured(Camera.java:518)
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.lambda$onConfigured$0(CallbackProxies.java:53)
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.$r8$lambda$XOBHWVfryPuKTX27fDYaiDBtLvc(Unknown Source:0)
E/AndroidRuntime(13388): 	at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy$$ExternalSyntheticLambda6.run(Unknown Source:4)
E/AndroidRuntime(13388): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/AndroidRuntime(13388): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/AndroidRuntime(13388): 	at java.lang.Thread.run(Thread.java:1012)

There was some information about this error in the CameraDeviceImp code, here is the link to it.


// Make sure that there all requests have at least 1 surface; all surfaces are non-null;
for (CaptureRequest request : requestList) {
   if (request.getTargets().isEmpty()) {
     throw new IllegalArgumentException(
     "Each request must have at least one Surface target");
   }
  
   for (Surface surface : request.getTargets()) {
     if (surface == null) {
         throw new IllegalArgumentException("Null Surface targets are not allowed");
     }
   }   
}
 

@khoren93 Could you please help me in resolving this issue ? or any suggestions to avoid this issue also appreciated.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant