If your issue is related to observed behavior, rather than API usage, please include information about the specific device (even if the device is an emulator).
Questions tagged [android-camerax]
512 questions
29
votes
7 answers
Converting ImageProxy to Bitmap
So, I wanted to explore new Google's Camera API - CameraX.
What I want to do, is take an image from camera feed every second and then pass it into a function that accepts bitmap for machine learning purposes.
I read the documentation on Camera X…
![](../../users/profiles/8358447.webp)
MaartinAndroid
- 1,268
- 1
- 14
- 37
26
votes
5 answers
Can I record video with CameraX (Android Jetpack)?
Google has released the new CameraX library as part of Jetpack. It looks great for taking pictures, but my use case also require making video's. I tried googling for that, but couldn't find anything.
So, is it possible to record videos with the…
![](../../users/profiles/359156.webp)
Peter Fortuin
- 4,462
- 8
- 36
- 65
23
votes
9 answers
How does CameraX library can turn ON/OFF the torch?
I am developing a feature with the possibility of switching the torch into ON/OFF states. Some days ago, we saw a new library from Google in io2019. I came up with an idea, why not use it.
After some time, I don't see any possibilities to use the…
![](../../users/profiles/10705587.webp)
Kewin Czupryński
- 303
- 2
- 8
22
votes
1 answer
ImageAnalysis.Analyzer only fires once
In the latest alpha (alpha08) I can't seem to figure out how to correctly configure everything so that the my Analyzer runs normally. I can see it work once, then it never runs again.
For various reasons I need to use a TextureView so I cannot swap…
![](../../users/profiles/353463.webp)
Luke
- 4,675
- 3
- 23
- 33
22
votes
1 answer
CameraX - I/zygote: Rejecting re-init on previously-failed class java.lang.Class
I am developing a simple app based on the CameraX Jetpack support library through the provided getting started guide and a GitHub repo. Getting the error
I/zygote: Rejecting re-init on previously-failed class…
![](../../users/profiles/282855.webp)
talha06
- 5,286
- 16
- 75
- 127
12
votes
4 answers
java.lang.BootstrapMethodError: Exception from call site #2 bootstrap method on CameraX (1.0.0-alpha06)
I am trying to use CameraX API to fetch photo, but after I updated to new API version 1.0.0-alpha06 it started to crash on
CameraX.bindToLifecycle(...)
method.
The log of error is:
Process: com.aximetria.aximetria.debug, PID: 2629
…
![](../../users/profiles/5212417.webp)
Peter Staranchuk
- 1,087
- 1
- 11
- 24
10
votes
2 answers
How to use manual focus in Android CameraX?
I am trying to do manual focus on CameraX the same as I do in Camera2 API
in Camera2 API I use the following code
final CaptureRequest.Builder captureBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);…
![](../../users/profiles/12338167.webp)
moLand
- 103
- 6
10
votes
7 answers
takePicture require executor on CameraX (1.0.0-alpha06)
After update from
androidx.camera:camera-core:1.0.0-alpha03
to
androidx.camera:camera-core:1.0.0-alpha06
signatures of methods setTargetAspectRatio (in ImageCaptureConfig.Builder) and takePicture (in ImageCapture) have been changed.
Official…
![](../../users/profiles/5212417.webp)
Peter Staranchuk
- 1,087
- 1
- 11
- 24
10
votes
5 answers
an error occurred by CameraX.bindToLifecycle()
java.lang.IllegalArgumentException: No supported surface combination
is found for camera device - Id : 0. May be attempting to bind too
many use cases.
why the bindToLifecycle() only choose imageCapture or videoCapture?
…
![](../../users/profiles/6407556.webp)
user6407556
- 183
- 2
- 6
10
votes
5 answers
java.lang.IllegalArgumentException: Suggested resolution map missing resolution for camera 1
This error occurs when using CameraX.LensFacing.FRONT, was testing on an emulator
E/AndroidRuntime: FATAL EXCEPTION: main
Process: meter.meter, PID: 15289
java.lang.RuntimeException: Unable to start activity…
![](../../users/profiles/2208996.webp)
VINNUSAURUS
- 1,349
- 3
- 15
- 32
9
votes
2 answers
How can I use a CameraView with Jetpack Compose?
Currently there's no equivalent to CameraView (and PreviewView) in Compose. Is it possible to wrap it and display it in a compose layout?
![](../../users/profiles/211150.webp)
icefex
- 433
- 1
- 6
- 12
9
votes
1 answer
Translate Firebase MLKit Bounding box coordinates to screen view coordinates
I am using the FirebaseVision Object detection to detect things from the CameraX camera preview. It is detecting things find but I am trying to draw the bounding box of the items detected over the camera preview. In doing so the bounding box that…
![](../../users/profiles/599346.webp)
tyczj
- 66,691
- 50
- 172
- 271
9
votes
4 answers
How to crop image rectangle in camera preview on CameraX
I have a custom camera app which has a centered rectangle view, as you can see below:
When I take a picture I want to ignore everything outside the rectangle. And this is my XML layout:
![](../../users/profiles/8291686.webp)
R Rifa Fauzi Komara
- 1,101
- 2
- 13
- 28
9
votes
3 answers
Why can't CameraX zoom in a picture as larger as I need in Android Studio?
I'm learning CameraX, and CameraXBasic is a sample code.
I write a zoomX function based CameraFragment.kt. you can see the Code A. I think the function can zoom in a picture any time.
I find that a picture can be zoom in when I invoke it with s a…
![](../../users/profiles/828896.webp)
HelloCW
- 476
- 10
- 77
- 178
8
votes
0 answers
CameraX works on Android Q but not on Android R
I am trying to create a custom camera app using CameraX by following the example from Google Codelabs.
The tutorial specifically states:
We recommend using an AVD that is based on Android 11 or higher.
It is working fine with API 29 (Android 10)…
![](../../users/profiles/7764977.webp)
Kellin Strook
- 349
- 2
- 13