https://kotlinlang.org logo
#fleet
Title
# fleet
c

Chris Mulder

03/20/2024, 2:14 PM
I am getting the following error, when trying to open Compose Preview:
Copy code
Caused by: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: font/Apercu-Bold.otf
	at org.jetbrains.compose.resources.ResourceReader_desktopKt.readResourceBytes(ResourceReader.desktop.kt:9)
	at org.jetbrains.compose.resources.ResourceReaderKt$DefaultResourceReader$1.read(ResourceReader.kt:23)
	at org.jetbrains.compose.resources.FontResources_skikoKt$Font$fontFile$3.invokeSuspend(FontResources.skiko.kt:38)
	at org.jetbrains.compose.resources.FontResources_skikoKt$Font$fontFile$3.invoke(FontResources.skiko.kt)
	at org.jetbrains.compose.resources.FontResources_skikoKt$Font$fontFile$3.invoke(FontResources.skiko.kt)
	at org.jetbrains.compose.resources.ResourceState_blockingKt$rememberResourceState$3$1.invokeSuspend(ResourceState.blocking.kt:46)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at org.jetbrains.compose.resources.ResourceState_blockingKt.rememberResourceState(ResourceState.blocking.kt:46)
	at org.jetbrains.compose.resources.FontResources_skikoKt.Font-DnXFreY(FontResources.skiko.kt:36)
The project has an Android & iOS target and on both builds the resources are working fine
r

Richard

03/20/2024, 2:18 PM
c

Chris Mulder

03/21/2024, 3:33 PM
Ah, yeah, thanks! I should have though about that myself. After adding the target "jvm" I was still faced with an issue since I was using Kamel to display a remote image, and no Ktor client was included for JVM. So I added the dependency to JVM target and now it works!
👍 1
6 Views