Xamarin.Forms iOS App Crashes on tapping inside Entry control after Latest update to 4.3.0.99

vijay84vijay84 INMember ✭✭
edited December 3 in Xamarin.Forms

Hi

My Xamarin.Forms iOS app is crashing while i tap on Entry control for typing. It happened after i updated to latest 4.3.0 from 3.6 version.
The error i see in output window & Error log file is this "The app has been terminated.
Failed to Stop app: An error occurred on client IDB1630281 while executing a reply for topic xvs/idb/16.3.0.281/stop-app"

Unable to understand the cause of this crash. I have attached error log file if anyone wants to view.

I am using Visual Studio 2019.

I have spent more than a week in fixing various issues after this update and able to run the app but now it crashes on above scenario.

Is anyone facing similar issue around or can anyone help me understand the cause?

Note: There is no change in the Xamal or code. It's all happening after the update. It was working fine with previous version 3.6 update.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Have you just tried to test it in a blank project ?

    Could you provide all the codes(xaml, code behind, custom renderer , ...) relevant to the entry here ?

    I need to reproduce the issue for the further troubleshooting.

  • vijay84vijay84 INMember ✭✭
    edited December 3

    I tested in blank Xamarin.Forms project adding an entry to it worked fine.
    This is my existing enterprise project which was working with 3.6 version earlier until now.

    Below is the Xamal for Entry

    <Entry Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Text="{Binding Username, Mode=TwoWay}" Keyboard="Text" Placeholder="Username" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=16}" />

    There is no code behind its just binding to to viewmodel as usual with property UserName. Unfortunately its breaking in my project, does not break in blank project. I can't see anything which can cause this crash on tapping in entry since Xamal is unchanged from 3.6 to 4.3.

    Also pasting my Entry CustomeRenderer below which i also removed while testing to identify if it is causing the crash issue but it also did not give any issue.

    ` public class XEntryRenderer : Xamarin.Forms.Platform.iOS.EntryRenderer
    {
    ///


    /// Raises the event.
    ///

    ///


    /// The instance containing the event
    /// data.
    ///
    protected override void OnElementChanged(ElementChangedEventArgs e)
    {
    base.OnElementChanged(e);
    if (Control != null)
    {
    if (!Control.Placeholder.StartsWith("Enter"))
    {
    Control.LeftView = new UIView(new CGRect(0, 0, 50, 0));
    }
                Control.LeftViewMode = UITextFieldViewMode.Always;
    
                Control.TintColor = UIColor.FromCGColor(Color.FromHex("#DCDCDC").ToCGColor());
                Control.Layer.CornerRadius = 0;
                Control.Layer.BorderWidth = 1;
                Control.BorderStyle = UITextBorderStyle.Line;
                Control.BackgroundColor = UIColor.White;
                Control.Layer.BorderColor = UIColor.White.CGColor;
                Control.Layer.ShadowColor = UIColor.Black.CGColor;
                Control.Layer.ShadowOpacity = 0.7f;
                Control.Layer.ShadowRadius = 3.0f;
                Control.Layer.MasksToBounds = false;
                Control.Layer.ShadowOffset = new System.Drawing.SizeF(-2f, 3f);
    
                Control.AddTarget(SetborderActive, UIControlEvent.EditingDidBegin);
                Control.AddTarget(SetborderInactive, UIControlEvent.EditingDidEnd);
                Control.SpellCheckingType = UITextSpellCheckingType.No;             // No Spellchecking
                Control.AutocorrectionType = UITextAutocorrectionType.No;           // No Autocorrection
                Control.AutocapitalizationType = UITextAutocapitalizationType.None; // No Autocapitalization
                // Copy paste disabled
                Control.InputAssistantItem.LeadingBarButtonGroups = null;
                Control.InputAssistantItem.TrailingBarButtonGroups = null;
                UIMenuController.SharedMenuController.SetMenuVisible(false, false);
            }
        }
    
        private void SetborderInactive(object sender, EventArgs e)
        {
            Control.Layer.BorderColor = UIColor.White.CGColor;
        }
    
        private void SetborderActive(object sender, EventArgs e)
        {
            Control.Layer.BorderColor = Color.FromHex("#FFE600").ToCGColor();
        }
    
    
        public override bool CanPerform(Selector action, NSObject withSender)
        {
            NSOperationQueue.MainQueue.AddOperation(() =>
            {
                UIMenuController.SharedMenuController.SetMenuVisible(false, false);
            });
    
            return base.CanPerform(action, withSender);
        }
    }`
    
  • ColeXColeX Member, Xamarin Team Xamurai

    Remove the custom renderer , and just remain <Entry/> in xaml to see if problem persists.

  • vijay84vijay84 INMember ✭✭
    edited December 4

    I did that too before posting this issue but the results are same.
    I am pasting the complete Xamal where the Entry reside for the reference.

    `

    <Grid.Padding>

    </Grid.Padding>
    <Grid.GestureRecognizers>

    </Grid.GestureRecognizers>

        <Grid.RowDefinitions>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="0.6*"></RowDefinition>
            <RowDefinition Height="0.4*"></RowDefinition>
            <RowDefinition Height="1.6*"></RowDefinition>
            <RowDefinition Height="1.4*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1.5*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="0.5*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="0.4*"></ColumnDefinition>
            <ColumnDefinition Width="0.6*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <ffimageloading:CachedImage DownsampleHeight="{Binding DeviceHeight}"  Grid.Row ="0" Grid.Column="0" Grid.RowSpan ="5" Grid.ColumnSpan="7" Aspect="AspectFill" VerticalOptions = "FillAndExpand" HorizontalOptions = "FillAndExpand" Source="{Binding BackgroundImage}" />
        <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5"  RowSpacing="0" ColumnSpacing="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.8*"></RowDefinition>
                <RowDefinition Height="1.5*"></RowDefinition>
                <RowDefinition Height="0.6*"></RowDefinition>
            </Grid.RowDefinitions>
    
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1.5*"></ColumnDefinition>
                <ColumnDefinition Width="5*"></ColumnDefinition>
                <ColumnDefinition Width="15*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <!--Logo-->
            <ffimageloading:CachedImage  Grid.Row="1" Grid.Column="1" Aspect="AspectFit" VerticalOptions = "Fill" HorizontalOptions = "Fill" Source="{Binding LogoImage}" />
        </Grid>
        <Grid Grid.Column="3" Grid.ColumnSpan="3"  Grid.Row="2" Grid.RowSpan="2" Padding="5" IsVisible="{Binding IsStage2}">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="0.2*"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="0.6*"></RowDefinition>
                <RowDefinition Height="0.6*"></RowDefinition>
                <RowDefinition Height="0.8*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1.2*"></ColumnDefinition>
                <ColumnDefinition Width="0.8*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="0.2*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" Text="Login" TextColor="White" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=24}"></Label>
            <Entry Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3"  Text="{Binding Username, Mode=TwoWay}" Keyboard="Text" Placeholder="Username" Completed="Entry_Completed_1" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=16}" />
            <Label Grid.Row="1" Grid.Column="0" Text="&#xE8D3;" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" Style="{StaticResource MaterialLabelInactive}" HorizontalOptions="Start" VerticalOptions="Center" Margin="20,0,0,0" TextColor="#999999" />
    
            <Entry x:Name="PWTB" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" IsPassword="True" Text="{Binding Password, Mode=TwoWay}" Keyboard="Text" Placeholder="Password" Completed="Entry_Completed" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=16}" />
            <Label Grid.Row="3" Grid.Column="0" Text="&#xE897;" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" Style="{StaticResource MaterialLabelInactive}" HorizontalOptions="Start" VerticalOptions="Center" Margin="20,0,0,0" TextColor="#999999" />
    
            <Grid Grid.Row="3" Grid.Column="3">
                <Label x:Name="PWShow"  Text="&#xf070;" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" Style="{StaticResource AwesomeLabelActive}"  HorizontalOptions="Center" VerticalOptions="Center" TextColor="#FFFFFF" />
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer Tapped="TogglePWTB" />
                </Grid.GestureRecognizers>
            </Grid>
    
            <Grid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4">
                <Label Text="Forgot your Username or Password?" TextColor="White" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=16}" VerticalOptions="Start" HorizontalOptions="Start" />
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding ForgetCommand}" />
                </Grid.GestureRecognizers>
            </Grid>
            <Grid Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3">
                <Label   FormattedText="{Binding Region}" TextColor="White" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=16}" />
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding RegionCommand}" />
                </Grid.GestureRecognizers>
            </Grid>
            <Grid Grid.Row="5" Grid.Column="3">
                <Label x:Name="Regioninfor"  Text="&#xf05a;" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" Style="{StaticResource AwesomeLabelActive}"  HorizontalOptions="Center" VerticalOptions="Center" TextColor="#FFFFFF" />
                <Grid.GestureRecognizers>
                    <TapGestureRecognizer Command="{Binding RegionInfoCommand}" />
                </Grid.GestureRecognizers>
            </Grid>
    
            <Button Grid.Row="6" Grid.Column="0" Text="Sign In" Command="{Binding LoginCommand}" IsVisible="{Binding IsBusy,Converter={StaticResource NegateBool}}" Style="{StaticResource ButtonsPrimary}" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" />
            <ActivityIndicator Grid.Row="6" Grid.Column="0" IsVisible="{Binding IsBusy}" IsRunning="True" Color="#ffe600" HorizontalOptions="Center" VerticalOptions="Center" HeightRequest="30" WidthRequest="30">
                <ActivityIndicator.Scale>
                    <OnPlatform x:TypeArguments="x:Double" Android="1" iOS="1.5" />
                </ActivityIndicator.Scale>
            </ActivityIndicator>
            <StackLayout Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal">
                <controls:CustomSwitch IsToggled="{Binding Offline}" VerticalOptions="Center" SwitchOffThumbColor="White"  SwitchOnThumbColor="White" SwitchOffColor="Gray" SwitchOnColor="#ffe600" IsEnabled="{Binding IsBusy,Converter={StaticResource NegateBool}}">
                    <controls:CustomSwitch.Scale>
                        <OnPlatform x:TypeArguments="x:Double" Android="1" iOS="0.75" />
                    </controls:CustomSwitch.Scale>
                </controls:CustomSwitch>
                <Label Text="Offline Mode" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=12}" VerticalOptions="Center" TextColor="White"></Label>
            </StackLayout>
        </Grid>
        <Grid Grid.Column="2" Grid.ColumnSpan="4"  Grid.Row="3" Grid.RowSpan="1"  IsVisible="{Binding IsStage1}">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="2.5*"></RowDefinition>
                <RowDefinition Height="0.3*"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.6*"></ColumnDefinition>
                <ColumnDefinition Width="0.1*"></ColumnDefinition>
                <ColumnDefinition Width="1.1*"></ColumnDefinition>
                <ColumnDefinition Width="0.2*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Padding="-2">
                <Label  Text="{Binding WelcomeHeadline}" TextColor="White" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=36}" ></Label>
            </Grid>
            <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Text="{Binding WelcomeText}" TextColor="White" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=15}"></Label>
            <Button Grid.Row="3" Grid.Column="0" Text="Continue" Command="{Binding ContinueCommand}" Style="{StaticResource ButtonsPrimary}" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" />
        </Grid>
        <Grid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="7">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="12*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="12*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
    
            <Grid Grid.Row="1" Grid.Column="1" ColumnSpacing="8">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <ffimageloading:CachedImage  Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFit" Source="{Binding LoginStateActiveImage}" IsVisible="{Binding IsStage1}" />
                <ffimageloading:CachedImage  Grid.Column="0" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFit" Source="{Binding LoginStateInactiveImage}" IsVisible="{Binding IsStage1,Converter={StaticResource NegateBool}}" />
                <ffimageloading:CachedImage  Grid.Column="1" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFit" Source="{Binding LoginStateActiveImage}" IsVisible="{Binding IsStage2}" />
                <ffimageloading:CachedImage  Grid.Column="1" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFit" Source="{Binding LoginStateInactiveImage}" IsVisible="{Binding IsStage2,Converter={StaticResource NegateBool}}" />
            </Grid>
        </Grid>
        <!--2 Factor-->
        <Grid   Grid.Row ="0" Grid.Column="0" Grid.RowSpan ="5" Grid.ColumnSpan="7" IsVisible="{Binding ShowSecondFactor}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50*"></ColumnDefinition>
                <ColumnDefinition Width="7*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="2.5*"></RowDefinition>
                <RowDefinition Height="50*"></RowDefinition>
            </Grid.RowDefinitions>
    
            <controls:SecondFactorWebView Grid.Row ="0" Grid.Column="0" Grid.RowSpan ="3" Grid.ColumnSpan="3" Source="{Binding SecondFactorSource}" />
            <Button Grid.Row="1" Grid.Column="1" Text="Back" Command="{Binding CancelCommand}" Style="{StaticResource ButtonsPrimary}" FontSize="{Binding ., Converter={StaticResource ConvFontSize},ConverterParameter=18}" />
        </Grid>
    </Grid>`
    
  • ColeXColeX Member, Xamarin Team Xamurai
    edited December 5

    We have received some issues from XF 4.3.0.99 recently , try to downgrade to 4.3.0.908675, or upgrade to 4.4.xx preview version .

Sign In or Register to comment.