-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[1.6.0] Could not load font #4387
Comments
Nevermind, I've just read the updated doc that multimodule is not supported yet. These font are indeed loaded from another module beside shared. Please tell me if i'm correct |
Yep, that's correct |
Issue to track #4229 |
I'm facing the same issue when using |
@MatkovIvan Is multi-module resource supported in 1.6.10-dev1523? |
I had the same issue. |
@parfenovedyard I thought they said multimodule requires Kotlin 2.0.0-Beta5 minimum? What kotlin version are you using |
You could try 1.6.10-dev1557 |
1.9.23 |
I'm using 1.6.2 version, and the issue happened. After downgraded to 16.1, the issue gone. Thanks I don't know why it's happing on newest version of Compose Plugin when it's fixed on 1.6.1. Look like they do not verify it enough. |
I just realized that Compose Resources throws this error right after you add any new font. Solution: You need to upgrade or lowgrade your Compose Plugin version to fix this issue after adding new font. |
Changing from 1.6.1 to 1.6.2 works for me |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
I am using Compose Plugin 1.5.1. Changing to 1.5.0+sync+run and back to 1.5.1 did not resolve this issue for me. Running Koala 2024.1.1 Patch 1. |
Happened on the new composeResources system:
FATAL EXCEPTION: main Process: , PID: 14880 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 androidx.compose.foundation.text.TextFieldSizeKt$textFieldMinSize$1.invoke(TextFieldSize.kt:47) at androidx.compose.foundation.text.TextFieldSizeKt$textFieldMinSize$1.invoke(TextFieldSize.kt:38) at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:270) at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:265) at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:136) at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:396) at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:396) at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:396) at androidx.compose.ui.ComposedModifierKt.materializeModifier(ComposedModifier.kt:265) at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke-Deg8D_g(Layout.kt:205) at androidx.compose.ui.layout.LayoutKt$materializerOf$1.invoke(Layout.kt:203) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.foundation.text.selection.SimpleLayoutKt.SimpleLayout(SimpleLayout.kt:79) at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:668) at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5$1.invoke(CoreTextField.kt:643) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.material3.TextFieldKt.TextFieldLayout(TextField.kt:617) at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke-eopBjH0(TextFieldImpl.kt:205) at androidx.compose.material3.TextFieldImplKt$CommonDecorationBox$3.invoke(TextFieldImpl.kt:113) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:228) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.material3.TextFieldTransitionScope.Transition-DTcfvLk(TextFieldImpl.kt:382) at androidx.compose.material3.TextFieldImplKt.CommonDecorationBox(TextFieldImpl.kt:103) at androidx.compose.material3.TextFieldDefaults.DecorationBox(TextFieldDefaults.kt:500) at androidx.compose.material3.TextFieldKt$TextField$2$1.invoke(TextField.kt:223) at androidx.compose.material3.TextFieldKt$TextField$2$1.invoke(TextField.kt:221) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:643) at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$5.invoke(CoreTextField.kt:642) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextFieldRootBox(CoreTextField.kt:1305) at androidx.compose.foundation.text.CoreTextFieldKt.CoreTextField(CoreTextField.kt:642) at androidx.compose.foundation.text.BasicTextFieldKt.BasicTextField(BasicTextField.kt:166) at androidx.compose.material3.TextFieldKt$TextField$2.invoke(TextField.kt:201) at androidx.compose.material3.TextFieldKt$TextField$2.invoke(TextField.kt:200) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
To Reproduce
Put google font inside composeResources(.tff extension):
then call it with FontResource
then use created font with Typography
Typography then used with MaterialTheme
Expected behavior
Font load and works
The text was updated successfully, but these errors were encountered: