Forum Xamarin Xamarin.Forms

Font asset not found Fonts/sans-serif-medium

MihaelMihael Member ✭✭
edited April 3 in Xamarin.Forms

Idk if it is because of new stable version 4.5.0.530 I updated my project to.
Everything was fine yesterday, now i get error "Font asset not found Fonts/sans-serif-medium" on this line Application.Current.MainPage = new AppShell();

StackTrace:
at Java.Interop.JniEnvironment+StaticMethods.CallStaticObjectMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <26521a5118b44c858c385715922b9d5d>:0
at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeObjectMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00018] in <26521a5118b44c858c385715922b9d5d>:0
at Android.Graphics.Typeface.CreateFromAsset (Android.Content.Res.AssetManager mgr, System.String path) [0x0004b] in <4ccdb3137d974856b786e1aeebbfbab6>:0
at Xamarin.Forms.Platform.Android.FontExtensions.LoadTypefaceFromAsset (System.String fontfamily) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\FontExtensions.cs:121
--- End of managed Java.Lang.RuntimeException stack trace ---
java.lang.RuntimeException: Font asset not found Fonts/sans-serif-medium
at android.graphics.Typeface.createFromAsset(Typeface.java:839)
at crc643f46942d9dd1fff9.ShellFlyoutRecyclerAdapter.n_onCreateViewHolder(Native Method)
at crc643f46942d9dd1fff9.ShellFlyoutRecyclerAdapter.onCreateViewHolder(ShellFlyoutRecyclerAdapter.java:56)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:142)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:41)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1556)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:888)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1255)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Edit: tried installing different Xamarin.Forms versions, same error.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Do you use custom font in your code ? If so check if Fonts/sans-serif-medium exists in project , and make its build action as AndroidAsset.

  • Roberto.6713Roberto.6713 USUniversity ✭✭

    I have the same problem, did you resolve it?

Sign In or Register to comment.