robinmanuelthiel / flexbutton

Flexible button control for Xamarin.Forms
MIT License
240 stars 34 forks source link

Setting Icon throwing System.NullReferenceException: Object reference not set to an instance of an object. #73

Closed LeoJHarris closed 5 years ago

LeoJHarris commented 5 years ago

Hi, I seem to be getting a System.NullReferenceException: Object reference not set to an instance of an object. when I set the Icon on the flexButton, I can confirm the image exists and is in my drawable folders called shopping_cart_white.png

<controls:FlexButton
                    BackgroundColor="{StaticResource XeniaRedThemeColor}"
                    BorderColor="White"
                    BorderThickness="2"
                    CornerRadius="40"
                    FontFamily="{StaticResource RegularFont}"
                    FontSize="{StaticResource SubHeader}"
                    ForegroundColor="White"
                    HeightRequest="80"
                    HorizontalOptions="End"
                    Icon="shopping_cart_white.png"
                    Text="Shopping Cart"
                    VerticalOptions="Center"
                    WidthRequest="120" />

Capture

When I remove the line Icon="shopping_cart_white.png" the null pointer issue goes away, any ideas please??

LeoJHarris commented 5 years ago

See stack trace attached:

exception.txt

robinmanuelthiel commented 5 years ago

Can you please confirm that this is still happening after updating to version 0.10.0? Should work with version 0.10.0. https://www.nuget.org/packages/Forms.Controls.FlexButton/0.10.0