Closed onseok closed 10 months ago
However, what do you guys suggest as the best way to load fonts for now apart from MOKO because this is a major blocker?
We are going to add support for fonts into our resource library next release
Plus the white background of UIKitView causes blinking which looks bad in dark mode. Any idea when this will be fixed properly?
Do you mean this issue?
Any tentative date for the next release with the fixes? Yes, that same issue. The blinking is horrible. Lottie and other libraries for auth blink in dark mode and look ugly. In fact any UI specific to iOS would see this problem in dark mode.
Any tentative date for the next release with the fixes?
It is a hard problem, we are investigating it right now. Currently we cannot provide estimations as it is still not clear what is the root cause.
No worries. Thanks a lot for the help. For now, using the flag forceMainThreadRendering = true
has subsided the crashes.
For anyone else looking for a fix for the font crash. Using a single font flavor in the font family stopped the font crashes as well. Not sure if it's a MOKO or CMP issue.
Eagerly waiting for the new release @pjBooms. Hopefully, UIKitView problems and resource library updates will be solved.
For anyone else looking for a fix for the font crash. Using a single font flavor in the font family stopped the font crashes as well. Not sure if it's a MOKO or CMP issue.
By "single font flavor in the font family", do you mean only one font file? If So, I use only one and it crashes. I don't use MOKO also, instead, just raw expect/actual
.
@GuilhE I feel your pain. I tried multiple implementations of expect/actual like how Tivi does it but none worked. Since I am using cocoa pods maybe that's why. Spent almost a week on this. Attaching my typography code maybe this can help you. I am using MOKO for now until CMP releases font support. As you can see I am using only one flavour. Using multiple was causing lags and crashes.
@Composable
fun SansSerifCondensed() = fontFamilyResource(Res.fonts.RobotoCondensed.medium)
@Composable
fun MedialTypography(): Typography {
val sansSerifCondensed = SansSerifCondensed()
return Typography(
labelLarge = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.Medium,
letterSpacing = 0.10000000149011612.sp,
lineHeight = 20.sp,
fontSize = 14.sp
),
labelMedium = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.Medium,
letterSpacing = 0.5.sp,
lineHeight = 16.sp,
fontSize = 12.sp
),
labelSmall = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.Medium,
letterSpacing = 0.5.sp,
lineHeight = 16.sp,
fontSize = 11.sp
),
bodyLarge = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.5.sp,
lineHeight = 24.sp,
fontSize = 16.sp
),
bodyMedium = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.25.sp,
lineHeight = 20.sp,
fontSize = 14.sp
),
bodySmall = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.4000000059604645.sp,
lineHeight = 16.sp,
fontSize = 12.sp
),
headlineLarge = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 40.sp,
fontSize = 32.sp
),
headlineMedium = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 36.sp,
fontSize = 28.sp
),
headlineSmall = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 32.sp,
fontSize = 24.sp
),
displayLarge = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = (-0.25).sp,
lineHeight = 64.sp,
fontSize = 57.sp
),
displayMedium = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 52.sp,
fontSize = 45.sp
),
displaySmall = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 44.sp,
fontSize = 36.sp
),
titleLarge = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.W400,
letterSpacing = 0.sp,
lineHeight = 28.sp,
fontSize = 22.sp
),
titleMedium = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.Medium,
letterSpacing = 0.15000000596046448.sp,
lineHeight = 24.sp,
fontSize = 16.sp
),
titleSmall = TextStyle(
fontFamily = sansSerifCondensed,
fontWeight = FontWeight.Medium,
letterSpacing = 0.10000000149011612.sp,
lineHeight = 20.sp,
fontSize = 14.sp
)
)
}
Oh but this approach works for me, it stopped working properly starting from 1.5.10-rc01
, that's why I opened this issue. With the latest versions, in my use case, it's harder to reproduce, but it's still there.
That's what the problem is. I am not sure when it started but it has been there since 1.5.1 I have tried expect/actual and moko but intermittent crashes are what is a dealbreaker App is already in production hence staying with the single font for now because that is the only one working without crashes.
We fixed Crash with fonts. Please take a look at this comment in another Issue: https://github.com/JetBrains/compose-multiplatform/issues/3822#issuecomment-1806367451
Can you please check it without usage of flag forceMainThreadRendering
at first. We hope, that new version of Skiko will help with this Crash as well.
But, if crash Crashed: RenderingDispatchQueue
will still appears, you can use forceMainThreadRendering
@dima-avdeev-jb
Please give me some time to confirm this.
Would this also mean I do not have to use the 0.0.0-dev1260 build and can fallback to 1.5.10?
If Crashed: RenderingDispatchQueue
crash still appears with Skiko 0.7.88, Do I have to use 0.0.0-dev1260 for the time being?
@LaatonWalaBhoot
It is good to test with Compose version 1.5.10
and with 0.0.0-dev1260
as well.
It will help us to better understand the problem.
Anyway, we want to fix all of it in next Compose 1.5.11
release
@dima-avdeev-jb
Font crash and lag are no longer happening with the new skiko version. That seems to be fixed.
However Crashed: RenderingDispatchQueue
is still there with 1.5.10
and 0.0.0-dev1260
For now moving to production with 0.0.0-dev1260
and forceMainThreadRendering = true
Hope this gets resolved in 1.5.11.
Would UIKitView white background also get addressed in 1.5.11?
Stacktrace:
Crashed: RenderingDispatchQueue
0 libobjc.A.dylib 0x8238 objc_loadWeakRetained + 144
1 Medial 0x10cc520 GrMtlPipelineState::setDepthStencilState(GrMtlRenderCommandEncoder*) + 160
2 Medial 0x10cc46c GrMtlPipelineState::setDrawState(GrMtlRenderCommandEncoder*, skgpu::Swizzle const&, GrXferProcessor const&) + 208
3 Medial 0x10cacc8 GrMtlOpsRenderPass::onBindPipeline(GrProgramInfo const&, SkRect const&) + 292
4 Medial 0xfe63ac GrOpsRenderPass::bindPipeline(GrProgramInfo const&, SkRect const&) + 164
5 Medial 0x108845c (anonymous namespace)::TextureOpImpl::onExecute(GrOpFlushState*, SkRect const&) + 132
6 Medial 0x10739f0 GrOp::execute(GrOpFlushState*, SkRect const&) + 232
7 Medial 0x10737d0 skgpu::ganesh::OpsTask::onExecute(GrOpFlushState*) + 1036
8 Medial 0xfd2c6c GrDrawingManager::executeRenderTasks(GrOpFlushState*) + 188
9 Medial 0xfd2644 GrDrawingManager::flush(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 1440
10 Medial 0xfd2e78 GrDrawingManager::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 168
11 Medial 0xfcd5f0 GrDirectContextPriv::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 360
12 Medial 0xfcc5c8 GrDirectContext::flush(SkSurface*, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&) + 148
13 Medial 0xec0394 SkSurface::flushAndSubmit(bool) + 84
14 Medial 0x3b9c88 kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$4$FUNCTION_REFERENCE$4.invoke#internal + 952 (Surface.kt:952)
15 Medial 0x3bb128 kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$4$FUNCTION_REFERENCE$4.$<bridge-UNN>invoke(){}#internal + 428 (MetalRedrawer.kt:428)
16 Medial 0x948298 kfun:kotlin.Function0#invoke(){}1:0-trampoline + 1 ([K][Suspend]Functions:1)
17 Medial 0x3bb1e8 kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$5$FUNCTION_REFERENCE$5.$<bridge-UNN>invoke(){}#internal + 15 (ObjectiveCUtils.kt:15)
18 Medial 0x948298 kfun:kotlin.Function0#invoke(){}1:0-trampoline + 1 ([K][Suspend]Functions:1)
19 Medial 0xd9bdb0 ___6f72672e6a6574627261696e732e636f6d706f73652e75693a75692f6f70742f6275696c644167656e742f776f726b2f356234626566333562333562396631322f636f6d706f73652f75692f75692f7372632f75696b69744d61696e2f6b6f746c696e2f616e64726f6964782f636f6d706f73652f75692f77696e646f772f4d6574616c52656472617765722e6b74_knbridge114_block_invoke + 200
20 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32
21 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
22 libdispatch.dylib 0xb534 _dispatch_lane_serial_drain + 668
23 libdispatch.dylib 0xc0a4 _dispatch_lane_invoke + 384
24 libdispatch.dylib 0x16cdc _dispatch_workloop_worker_thread + 648
25 libsystem_pthread.dylib 0xddc _pthread_wqthread + 288
26 libsystem_pthread.dylib 0xb7c start_wqthread + 8
I'm a bit late to the party but I encountered this issue after upgrading to 1.5.10-beta02
. I've been stuck on 1.5.10-beta01
ever since. My app does have a ton of photos, it's a photo sharing app. I load images on ios with UIImage and the KingFisher library.
Crashed: com.apple.main-thread
0 Runwayy 0x17b43e8 GrGpuResource::release() + 4354180072
1 Runwayy 0x17c07cc GrResourceCache::releaseAll() + 4354230220
2 Runwayy 0x17c07cc GrResourceCache::releaseAll() + 4354230220
3 Runwayy 0x17a1704 GrDirectContext::~GrDirectContext() + 4354103044
4 Runwayy 0x17a1888 GrDirectContext::~GrDirectContext() + 4354103432
5 Runwayy 0x5d120c kfun:org.jetbrains.skia.impl.FinalizationThunk.clean#internal + 19 (Managed.native.kt:19)
6 Runwayy 0x5d0ba4 kfun:org.jetbrains.skia.impl.Managed#close(){} + 1 (Native.native.kt:1)
7 Runwayy 0x785b24 kfun:androidx.compose.ui.window.ComposeWindow#objc:viewDidDisappear: + 297 (MetalRedrawer.kt:297)
8 Runwayy 0x1550368 _6f72672e6a6574627261696e732e636f6d706f73652e75693a75692f6f70742f6275696c644167656e742f776f726b2f356234626566333562333562396631322f636f6d706f73652f75692f75692f7372632f75696b69744d61696e2f6b6f746c696e2f616e64726f6964782f636f6d706f73652f75692f77696e646f772f436f6d706f736557696e646f772e75696b69742e6b74_kncfun368 + 4351673192
9 UIKitCore 0xcbec -[UIViewController _setViewAppearState:isAnimating:] + 1012
10 UIKitCore 0x7edb2c __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke_2 + 168
11 UIKitCore 0x2457dc __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke + 192
12 CoreFoundation 0xa1cc __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 24
13 CoreFoundation 0x376b8 -[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:] + 92
14 UIKitCore 0xcdd4 -[UIViewController _setViewAppearState:isAnimating:] + 1500
15 UIKitCore 0x4672a8 -[UIViewController __viewDidDisappear:] + 136
16 UIKitCore 0x2206c4 -[UIViewController _endAppearanceTransition:] + 192
17 UIKitCore 0x14cef0 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 1100
18 UIKitCore 0x1fd49c __49-[UINavigationController _startCustomTransition:]_block_invoke + 208
19 UIKitCore 0x2b1d10 -[_UIViewControllerTransitionContext completeTransition:] + 116
20 UIKitCore 0x80779c __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke_5 + 604
21 UIKitCore 0x1060598 __UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK__ + 36
22 UIKitCore 0xce148 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 636
23 UIKitCore 0xcd0a4 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 436
24 UIKitCore 0xcc7c0 -[UIViewAnimationState animationDidStop:finished:] + 196
25 UIKitCore 0xcc8d4 -[UIViewAnimationState animationDidStop:finished:] + 472
26 QuartzCore 0x134e0 CA::Layer::run_animation_callbacks(void*) + 232
27 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
28 libdispatch.dylib 0x126a4 _dispatch_main_queue_drain + 928
29 libdispatch.dylib 0x122f4 _dispatch_main_queue_callback_4CF + 44
30 CoreFoundation 0x98c28 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
31 CoreFoundation 0x7a560 __CFRunLoopRun + 1992
32 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612
33 GraphicsServices 0x135c GSEventRunModal + 164
34 UIKitCore 0x39cf58 -[UIApplication _run] + 888
35 UIKitCore 0x39cbbc UIApplicationMain + 340
36 SwiftUI 0x1bcc50 OUTLINED_FUNCTION_895 + 2472
37 SwiftUI 0x1231ec block_copy_helper.1 + 496
38 SwiftUI 0x10d294 OUTLINED_FUNCTION_901 + 2752
39 Runwayy 0x6dc0 main + 4 (iOSApp.swift:4)
40 ??? 0x1e9ab4dec (Missing)
@LaatonWalaBhoot Thanks so much for good assist in problem solving!
Yeah, for now you can use Compose 0.0.0-dev1260
and forceMainThreadRendering = true with custom Skiko version as well.
I am sure, that Compose 1.5.11
will contains fix with fonts.
I hope fix for Crashed: RenderingDispatchQueue
as well.
As for white backgroud - not sure here. First of all we want to fix and publish as fast as possible all critical bugs. White background may be fixed later... I don't know yet.
@ToluwaniO can please provide a minial reproducible sample of your problem on GitHub ?
@dima-avdeev-jb Thanks so much for the help. We launched on Production with CMP today. You and your team have done some awesome work. Eagerly waiting for 1.5.11.
@LaatonWalaBhoot
Hi, could you kindly check if 0.0.0-dev1270
solves the issue (without forceMainThreadRendering)
@elijah-semyonov Please spare me some time. In the middle of the prod release. Will update you at the earliest
@LaatonWalaBhoot have not you tried the 0.0.0-dev1270
build yet? We need to decide if we should disable parallel rendering in 1.5.11
@pjBooms Not yet. But I will do it today. Please give me 12 hours to respond. Apologies for the delay. Have been stuck with production release
@pjBooms @elijah-semyonov
The crash is still there with 0.0.0-dev1270
and without forceMainThreadRendering
Stacktrace
Crashed: RenderingDispatchQueue
0 libobjc.A.dylib 0x8238 objc_loadWeakRetained + 144
1 Medial 0x10e6c34 GrMtlPipelineState::setDepthStencilState(GrMtlRenderCommandEncoder*) + 160
2 Medial 0x10e6b80 GrMtlPipelineState::setDrawState(GrMtlRenderCommandEncoder*, skgpu::Swizzle const&, GrXferProcessor const&) + 208
3 Medial 0x10e53dc GrMtlOpsRenderPass::onBindPipeline(GrProgramInfo const&, SkRect const&) + 292
4 Medial 0x1000ac0 GrOpsRenderPass::bindPipeline(GrProgramInfo const&, SkRect const&) + 164
5 Medial 0x10a2b70 (anonymous namespace)::TextureOpImpl::onExecute(GrOpFlushState*, SkRect const&) + 132
6 Medial 0x108e104 GrOp::execute(GrOpFlushState*, SkRect const&) + 232
7 Medial 0x108dee4 skgpu::ganesh::OpsTask::onExecute(GrOpFlushState*) + 1036
8 Medial 0xfed380 GrDrawingManager::executeRenderTasks(GrOpFlushState*) + 188
9 Medial 0xfecd58 GrDrawingManager::flush(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 1440
10 Medial 0xfed58c GrDrawingManager::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 168
11 Medial 0xfe7d04 GrDirectContextPriv::flushSurfaces(SkSpan<GrSurfaceProxy*>, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&, skgpu::MutableTextureState const*) + 360
12 Medial 0xfe6cdc GrDirectContext::flush(SkSurface*, SkSurfaces::BackendSurfaceAccess, GrFlushInfo const&) + 148
13 Medial 0xedaaa8 SkSurface::flushAndSubmit(bool) + 84
14 Medial 0x3ba160 kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$4$FUNCTION_REFERENCE$4.invoke#internal + 956 (Surface.kt:956)
15 Medial 0x3bb75c kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$4$FUNCTION_REFERENCE$4.$<bridge-UNNB>invoke(kotlin.Boolean){}#internal + 441 (MetalRedrawer.kt:441)
16 Medial 0x950eb0 kfun:kotlin.Function1#invoke(1:0){}1:1-trampoline + 1 ([K][Suspend]Functions:1)
17 Medial 0x3bb92c kfun:androidx.compose.ui.window.MetalRedrawer.$draw$lambda$5$FUNCTION_REFERENCE$5.$<bridge-UNN>invoke(){}#internal + 140 (LocalUIKitInteropContext.kt:140)
18 Medial 0x951530 kfun:kotlin.Function0#invoke(){}1:0-trampoline + 1 ([K][Suspend]Functions:1)
19 Medial 0xdb64c4 ___6f72672e6a6574627261696e732e636f6d706f73652e75693a75692f6f70742f6275696c644167656e742f776f726b2f356234626566333562333562396631322f636f6d706f73652f75692f75692f7372632f75696b69744d61696e2f6b6f746c696e2f616e64726f6964782f636f6d706f73652f75692f77696e646f772f4d6574616c52656472617765722e6b74_knbridge130_block_invoke + 200
20 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32
21 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
22 libdispatch.dylib 0xb534 _dispatch_lane_serial_drain + 668
23 libdispatch.dylib 0xc0a4 _dispatch_lane_invoke + 384
24 libdispatch.dylib 0x16cdc _dispatch_workloop_worker_thread + 648
25 libsystem_pthread.dylib 0xddc _pthread_wqthread + 288
26 libsystem_pthread.dylib 0xb7c start_wqthread + 8
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug We've received a handful of reports of crashes on iOS via the AppStore & Firebase Crashlytics. We have not yet been able to reproduce the crash ourselves.
Affected platforms Select one of the platforms below:
Versions
To Reproduce We don't have reproduction steps as of yet. We've seen a half-dozen of reports via the AppStore & Firebase Crashlytics.
Expected behavior The app should not crash.
Screenshots N/A
Additional context