Good morning all. I was trying to use compose multiplatform to build a design kit library. I’m using compose component resources library. However, the problem i’m facing is that it can’t load the fonts in the android application itself:
Copy code
java.lang.IllegalStateException: Could not load font at androidx.compose.ui.text.font.TypefaceRequestCache.runCached(FontFamilyResolver.kt:207) at androidx.compose.ui.text.font.FontFamilyResolverImpl.resolve(FontFamilyResolver.kt:92) at androidx.compose.ui.text.font.FontFamilyResolverImpl.resolve-DPcqOEQ(FontFamilyResolver.kt:79) at
I took a look at the “aar” that is generated, and for some reason it’s putting fonts in the “assets” folder instead of the “res” folder. I did run across a blurb from an article that says this:
Copy code
It does not support a multimodule project at this time.
It seems like just putting the files in the “res” directory instead of “assets” would fix this. Has anyone had any experience using this in a multi module project?
mattinger
02/15/2024, 2:47 PM
PS: I even enabled previews in the multiplatform library module itself, but i get the same error while trying to render the preview.
mattinger
02/16/2024, 6:53 PM
THis seems like mostly a preview issue, because running the preview on the actual emulator seems to work fine.