I'm continuously getting this error.when i try to open up camera using CameraX library. same code runs on other device less than pie. but not running on pie(Camera is not showing)
Here is my code: and I'm also using life data in my project can it cause any issue ?
val previewConfig = PreviewConfig.Builder()
.setLensFacing(CameraX.LensFacing.BACK)
.build()
val preview = Preview(previewConfig)
preview.setOnPreviewOutputUpdateListener { previewOutput ->
_textureView.surfaceTexture = previewOutput.surfaceTexture
}
val imageAnalysisConfig = ImageAnalysisConfig.Builder()
.build()
val imageAnalysis = ImageAnalysis(imageAnalysisConfig)
val qrCodeAnalyzer = QRCodeAnalyzer { qrCodes ->
qrCodes.forEach {
Log.d("MainActivity", "QR Code detected: `${it.rawValue}.")`
val intent = intent.putExtra("RESULT",it.rawValue)
setResult(Activity.RESULT_OK,intent)
finish()
}
}
imageAnalysis.analyzer = qrCodeAnalyzer
// We need to bind preview and imageAnalysis use cases
CameraX.bindToLifecycle(this as LifecycleOwner , preview, imageAnalysis)
Logs: Check out the logs I'm getting
E/GLConsumer: [SurfaceTexture-0-3196-1] updateAndRelease: GLConsumer is not attached to an OpenGL ES context
E/GLConsumer: [SurfaceTexture-0-3196-1] updateAndRelease: GLConsumer is not attached to an OpenGL ES context
E/GLConsumer: [SurfaceTexture-0-3196-1] updateAndRelease: GLConsumer is not attached to an OpenGL ES context
E/GLConsumer: [SurfaceTexture-0-3196-1] updateAndRelease: GLConsumer is not attached to an OpenGL ES context