Skip to content

SearchView component throws error for missing font on Android #715

@jshafferman-lt

Description

@jshafferman-lt

We recently starting using the toolkit's SearchView component. We have noticed an error that is occurring that doesn't stop the component from working but wanted to know how to correctly handle it. The error is the following:

Microsoft.Maui.FontManager: Warning: Unable to load font '/data/user/0/com.vermeer.boreplan/cache/toolkit-icons.ttf' from assets.

Java.Lang.RuntimeException: Font asset not found /data/user/0/com.vermeer.boreplan/cache/toolkit-icons.ttf
at Java.Interop.JniEnvironment.StaticMethods.CallStaticObjectMethod(JniObjectReference type, JniMethodInfo method, JniArgumentValue* args)
at Java.Interop.JniPeerMembers.JniStaticMethods.InvokeObjectMethod(String encodedMember, JniArgumentValue* parameters)
at Android.Graphics.Typeface.CreateFromAsset(AssetManager mgr, String path)
at Microsoft.Maui.FontManager.LoadTypefaceFromAsset(String fontfamily, Boolean warning) in /_/src/Core/src/Fonts/FontManager.Android.cs:line 133
--- End of managed Java.Lang.RuntimeException stack trace ---

Simply by placing the the search view component on the page, we get this error. I am assuming that I need to register that toolkit-icons.ttf in the maui program but not sure if I need to bring it into the resource folder since on iOS this error does not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions