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

Crash with UIKitView that wraps a MapLibre MLNMapView #4447

Closed
brewin opened this issue Mar 7, 2024 · 0 comments · Fixed by JetBrains/compose-multiplatform-core#1194
Closed
Assignees
Labels

Comments

@brewin
Copy link

brewin commented Mar 7, 2024

Describe the bug
Using 1.6.10-dev1488, app crashes with drawable must not be nil. when using a MapLibre MLNMapView. It works with 1.6.10-dev1457. The issue seems to be related to the Metal backend.

Possibly related to JetBrains/compose-multiplatform-core#1145

[CAMetalLayer nextDrawable] returning nil because allocation failed.
-[_MTLCommandBuffer presentDrawable:], line 771: error 'drawable must not be nil.'

Affected platforms

  • iOS

Versions

  • Kotlin version*: 1.9.22
  • Compose Multiplatform version*: 1.6.10-dev1488
  • OS version(s)* (required for Desktop and iOS issues): iOS 17.0
  • OS architecture (x86 or arm64): arm64
  • Device (model or simulator for iOS issues): All

To Reproduce
Run iosApp: https://github.com/brewin/cmp-bug

@brewin brewin added bug Something isn't working submitted labels Mar 7, 2024
@igordmn igordmn added reproduced crash ios p:high High priority uikit interop p:critical Critical priority and removed p:high High priority labels Mar 7, 2024
@igordmn igordmn removed the submitted label Mar 12, 2024
MatkovIvan added a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 14, 2024
## Proposed Changes

Regression after #1145 (more specific is -
156b2ee)
- it was replaced by a zero-size layout that prevented drawing anything
and might lead to crashes in native views due to a zero size.
Please note that before we had incorrect/inconsistent behavior - iOS
interop occupied max available space. This PR aligns behaviour with
[`AndroidView`](https://github.com/JetBrains/compose-multiplatform-core/blob/v1.6.0/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidViewHolder.android.kt#L387)
and just
[`Box`](https://github.com/JetBrains/compose-multiplatform-core/blob/v1.6.0/compose/foundation/foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Box.kt#L212-L214)

## Testing

Test: mpp demo, pages with interop

## Issues Fixed

Fixes JetBrains/compose-multiplatform#4447
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants