Hello guys. Not sure this is the right channel to ...
# compose
m
Hello guys. Not sure this is the right channel to ask my issue. Feel free to point me out if incorrect. I'm having a compose preview issue. (full error log below) I'm using a shared-ui compose multiplatform module from android module. and the preview in the android module doesn't work if i wrap it with my theme which contains my custom font. it was working fine before. and i remember i started having issues after a few dependency upgrades for kotlin, compose and other stuffs. I also found a similar issue on issue tracker which is closed already. but it's happening again on compose mulitplatform latest version. https://youtrack.jetbrains.com/issue/CMP-4387/1.6.0-Could-not-load-font Used versions: Kotlin:
2.0.20
Compose Multiplatform:
1.7.0-beta02
Jetpack Compose(android):
2024.09.02
(BOM) Android Studio:
Koala Feature Drop | 2024.1.2 Patch 1
m
I found this example app to prove working custom font loading on multiplatform project: https://github.com/JetBrains/compose-multi-platform/tree/master/examples/codeviewer
🙌 1
👀 1
m
Thanks @Mărcuţ Andrei I'll try it out.
@Mărcuţ Andrei I just checked the project and seems like there are no preview usage in the whole project. Just wanna clarify that, my issue is not about not being able to use custom font. It's working fine when we run it on the device. Only the
Preview
on android module is not working. And it was working previously before I updated those dependencies (compose, kotlin, etc..)
e
Just raised a similiar question on YouTrack again. There was a pull request merged adressing this but it does not seem to work anymore or there is some specific version combinations required. https://youtrack.jetbrains.com/issue/CMP-7205/commonMain-Compose-Resources-break-androidMain-Preview