-
Notifications
You must be signed in to change notification settings - Fork 28
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
IrLinkageError for UIKitView after upgrading app to compose 1.7.0 #108
Comments
I'm facing a similar issue. |
Same issue here. |
I've found temporary solution. Since compose multiplatform So we need to fix import androidx.compose.ui.viewinterop.UIKitView
// import androidx.compose.ui.interop.UIKitView
UIKitView(
modifier = modifier,
// background = Color.Black,
factory = {
val dispatchGroup = dispatch_group_create()
val cameraContainer = UIView()
cameraContainer.backgroundColor = UIColor.blackColor // set background color
cameraContainer.layer.addSublayer(cameraPreviewLayer)
cameraPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
dispatch_group_enter(dispatchGroup)
dispatch_async(queue) {
captureSession.startRunning()
dispatch_group_leave(dispatchGroup)
}
dispatch_group_notify(dispatchGroup, dispatch_get_main_queue()) {
state.onCameraReady()
}
cameraContainer
},
update = { view ->
cameraPreviewLayer.setFrame(view.bounds) // set frame of cameraPreviewLayer
}
// onResize = { view: UIView, rect: CValue<CGRect> ->
// CATransaction.begin()
// CATransaction.setValue(true, kCATransactionDisableActions)
// view.layer.setFrame(rect)
// cameraPreviewLayer.setFrame(rect)
// CATransaction.commit()
// },
) It works in Kotlin |
For me this didnt work. we fixed this by moving the UIKitView() to a BoxWithConstraints and use the constraints for the size:
|
@bevice1 Works for me too. Thanks |
How to apply these fixes? |
just clone the code of prrkaboo-ui and set it as a module in your project |
I've upgraded my app using you library to jetpack compose 1.7.0 but now i get this error when trying to start camera.
I think it's because of different versions of compose in use.
They've change UIKitView implementation and deprecated old. And I guess that leads to the error.
The text was updated successfully, but these errors were encountered: