This is a migrated thread and some comments may be shown as answers.

FontFamily setting crashes iOS

4 Answers 196 Views
AutoCompleteView
This is a migrated thread and some comments may be shown as answers.
Shalin
Top achievements
Rank 1
Iron
Iron
Shalin asked on 06 Feb 2019, 09:28 AM

hi

if we set font family in autocompleteview, iOS application crashes.

in page,

FontFamily="{StaticResource RegularFont}"

in App.xaml,

<OnPlatform x:TypeArguments="x:String" x:Key="RegularFont">
                <On Platform="Android" Value="Heebo-Light.ttf#Heebo Light"/>
                <On Platform="iOS" Value="HelveticaNeue"/>
                <On Platform="UWP" Value="Assets/Fonts/HelveticaNeue.ttf#HelveticaNeue"/>
            </OnPlatform>

Crash details,

Message,

Value cannot be null.
Parameter name: descriptor

Stacktrace,

at UIKit.UIFont._FromDescriptor (UIKit.UIFontDescriptor descriptor, System.nfloat pointSize) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIFont.g.cs:106
at UIKit.UIFont.FromDescriptor (UIKit.UIFontDescriptor descriptor, System.nfloat pointSize) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIFont.cs:179
at Telerik.XamarinForms.InputRenderer.iOS.EntryAdapter.UpdateFont (Telerik.XamarinForms.Input.RadEntry sourceOwner, Telerik.XamarinForms.InputRenderer.iOS.BorderUITextField targetOwner) [0x0007a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
at Telerik.XamarinForms.InputRenderer.iOS.EntryAdapter.UpdateCore (Telerik.XamarinForms.Input.RadEntry sourceOwner, Telerik.XamarinForms.InputRenderer.iOS.BorderUITextField targetOwner, System.String propertyName) [0x0014d] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
at Telerik.XamarinForms.Common.FacadeAdapterBase`2[S,T].Update (System.Object sourceOwner, System.Object targetOwner, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00000] in <b1d124df8dbf4987b1a7f6b0a5485748>:0
at Telerik.XamarinForms.Common.XamarinToNativeControlExtensions.Update[T,K] (T nativeElement, K xfЕlement, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00031] in <b1d124df8dbf4987b1a7f6b0a5485748>:0
at Telerik.XamarinForms.InputRenderer.iOS.EntryRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0002a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:150
at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:370
at Telerik.XamarinForms.Input.RadEntry.OnPropertyChanged (System.String propertyName) [0x0002a] in <e72706fd0dd5405fabc91cd72e3c9f5d>:0
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:623
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:417
at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00225] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173
at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:615
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/Foundation/NSAction.cs:152
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.13/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at listLayout.iOS.Application.Main (System.String[] args) [0x00001] in /Users/xamarindev/Documents/sample/listLayout/listLayout/listLayout.iOS/Main.cs:17

 

4 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 08 Feb 2019, 11:46 AM
Hello Shalin,

Thank you for the provided stack-trace.

This exception occurs on iOS when the file names of the fonts used in the project are not added to the info.plist file inside the iOS project. For more information how to add custom fonts in Xamarin.Forms please check the following article: Custom Fonts in Xamarin.Forms

I hope I was helpful. 

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shalin
Top achievements
Rank 1
Iron
Iron
answered on 08 Feb 2019, 12:10 PM
as i know "HelveticaNeue" is already in iOS, even though same font works fine in every other places through app.
0
Didi
Telerik team
answered on 08 Feb 2019, 01:35 PM
Hi Shalin,

I have tested similar scenario and I reproduced the same exception when the fonts are not added to the info.plist file. 

Could you please verify that the exception occurs when the fonts were added to the info.plist file. And if so could you please send me a sample project where the issue could be reproduced? In this case I could research it further. Note that you should open a support ticket and attach the project there because in the forum only image attachments are allowed.

Thank you in advance.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shalin
Top achievements
Rank 1
Iron
Iron
answered on 11 Feb 2019, 05:23 AM

hi,

as i know "HelveticaNeue" is already in iOS, so i have not add it to iOS project. Anyway, i'll try adding just name to info.plist and try.

but for record same use of font works fine in app, even inside other telerik controllers.

Tags
AutoCompleteView
Asked by
Shalin
Top achievements
Rank 1
Iron
Iron
Answers by
Didi
Telerik team
Shalin
Top achievements
Rank 1
Iron
Iron
Share this question
or