Arun
04/27/2021, 11:59 AMFatal Exception: java.lang.IllegalStateException
Cannot create Typeface from ResourceFont(resId=2131296258, weight=FontWeight(weight=600), style=Normal)
I’m using a custom font. This is working fine on Android 11 but crashing on Android 10. Any idea why?Arun
04/27/2021, 12:00 PMval IbmPlexSansFontFamily = FontFamily(
Font(R.font.ibm_plex_regular),
Font(R.font.ibm_plex_medium, FontWeight.Medium),
Font(R.font.ibm_plex_semi_bold, FontWeight.SemiBold),
)
Arun
04/27/2021, 12:00 PMFatal Exception: java.lang.IllegalStateException
Cannot create Typeface from ResourceFont(resId=2131296258, weight=FontWeight(weight=600), style=Normal)
keyboard_arrow_up
androidx.compose.ui.text.platform.TypefaceAdapter.create (TypefaceAdapter.java:243)
androidx.compose.ui.text.platform.TypefaceAdapter.create (TypefaceAdapter.java:143)
androidx.compose.ui.text.platform.extensions.TextPaintExtensions_androidKt.createTypeface (TextPaintExtensions_androidKt.java:123)
androidx.compose.ui.text.platform.extensions.TextPaintExtensions_androidKt.applySpanStyle (TextPaintExtensions_androidKt.java:53)
androidx.compose.ui.text.platform.AndroidParagraphIntrinsics.<init> (AndroidParagraphIntrinsics.java:66)
androidx.compose.ui.text.platform.AndroidParagraphIntrinsics_androidKt.ActualParagraphIntrinsics (AndroidParagraphIntrinsics_androidKt.java:128)
androidx.compose.ui.text.ParagraphIntrinsicsKt.ParagraphIntrinsics (ParagraphIntrinsicsKt.java:54)
androidx.compose.ui.text.MultiParagraphIntrinsics.<init> (MultiParagraphIntrinsics.java:76)
androidx.compose.foundation.text.TextDelegate.layoutIntrinsics (TextDelegate.java:126)
androidx.compose.foundation.text.TextDelegate.layoutText-K40F9xA (TextDelegate.java:150)
androidx.compose.foundation.text.TextDelegate.layout-NN6Ew-U (TextDelegate.java:227)
androidx.compose.foundation.text.TextController$measurePolicy$1.measure-3p2s80s (TextController.java:256)
androidx.compose.ui.node.InnerPlaceable.performMeasure-BRTryo0 (InnerPlaceable.java:45)
Adam Powell
04/27/2021, 1:24 PMAdam Powell
04/27/2021, 1:25 PMSiyamed
04/27/2021, 5:31 PMSiyamed
04/27/2021, 5:31 PMSiyamed
04/27/2021, 8:56 PMlooks like we didnt rethrow the expeptions in the source code, but that message only.Let me rephare this: since the exception is ignored and not provided to the compose, looking at the exception I do not understand why it fails. If it worked on Android 11, but does not work on Android 10, there is almost no possibility that we can fix it on Compose.
Siyamed
04/27/2021, 8:58 PMKort
04/28/2021, 3:52 PMRahul Sainani
05/10/2021, 10:23 AMScott Kruse
09/16/2021, 8:10 PM