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

Front Camera still crash #10

Closed
shivam2702 opened this issue May 2, 2017 · 2 comments
Closed

Front Camera still crash #10

shivam2702 opened this issue May 2, 2017 · 2 comments
Labels
Milestone

Comments

@shivam2702
Copy link

fotoapparat = Fotoapparat
.with(this)
.into(cameraView)
.photoSize(standardRatio(biggestSize()))
.previewSize(standardRatio(biggestSize()))
.lensPosition(front())
.focusMode(firstAvailable(
continuousFocus(),
autoFocus(),
fixed()
))
.flash(firstAvailable(
autoRedEye(),
autoFlash(),
torch()
))
.logger(loggers(
logcat(),
fileLogger(this)
))
.build();

PID: 25731
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:118)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20)
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at io.fotoapparat.result.PendingResult.getResultUnsafe(PendingResult.java:116)
at io.fotoapparat.result.PendingResult.access$100(PendingResult.java:20) 
at io.fotoapparat.result.PendingResult$2.run(PendingResult.java:97) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at io.fotoapparat.result.PendingResult$1.call(PendingResult.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
Caused by: java.lang.IllegalStateException: Requested to set the exposure mode but the flash mode has not been provided.
at io.fotoapparat.hardware.v2.parameters.CaptureRequestBuilder.validate(CaptureRequestBuilder.java:113)
at io.fotoapparat.hardware.v2.parameters.CaptureRequestBuilder.build(CaptureRequestBuilder.java:103)
at io.fotoapparat.hardware.v2.parameters.CaptureRequestFactory.createCaptureRequest(CaptureRequestFactory.java:129)
at io.fotoapparat.hardware.v2.lens.operations.LensOperationsFactory.createCaptureOperation(LensOperationsFactory.java:83)
at io.fotoapparat.hardware.v2.lens.executors.CaptureExecutor.takePicture(CaptureExecutor.java:27)
at io.fotoapparat.hardware.v2.Camera2.takePicture(Camera2.java:151)
at io.fotoapparat.routine.TakePictureTask$1.call(TakePictureTask.java:33)
at io.fotoapparat.routine.TakePictureTask$1.call(TakePictureTask.java:16)
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818)

This error was solved when i remove the flash section

fotoapparat = Fotoapparat
.with(this)
.into(cameraView)
.photoSize(standardRatio(biggestSize()))
.previewSize(standardRatio(biggestSize()))
.lensPosition(front())
.focusMode(firstAvailable(
continuousFocus(),
autoFocus(),
fixed()
))
.logger(loggers(
logcat(),
fileLogger(this)
))
.build();

So what will happen if some devices have front facing flash....

and can you please provide a method to flip the front face selfie?

@dmitry-zaitsev dmitry-zaitsev added this to the 1.0.0 milestone May 2, 2017
@Diolor
Copy link
Member

Diolor commented May 2, 2017

Sure it exists,

.flash(firstAvailable(
  autoRedEye(),
  autoFlash(),
  torch(),
  off()  <-- you need this one too
))

Just the logs are not explicit. That's why #9 is open :)

@Diolor Diolor closed this as completed May 2, 2017
@shivam2702
Copy link
Author

Thanks 👍

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

No branches or pull requests

3 participants