.NET Core 3.1 Angular ANZ 9.0.1
Hey,
I get the following error only when running the iOS application on my iPhone. When using the simulator its fine. On Android it works fine on both a simulator and a physical device. Its at runtime after the splash screen stage has completed.
Unhandled Exception *: Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate SynapWare.Views.LoginView ---> System.InvalidCastException: Specified cast is not valid.
10 Answer(s)
-
0
Hi,
It is really hard to trakc this problem. Maybe this could help you https://stackoverflow.com/a/48732272/6681451
-
0
Thanks @ismcagdas,
I dont make use of DataTemplates on the login page.
Setup iOS dev on my new iMac and same error; only an issue on a physical device (iPhone 11 pro, 14.3 if it matters at all)
My LoginView.xaml:
<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Name="LoginPage" xmlns:base="clr-namespace:SynapWare.ViewModels.Base;assembly=SynapWare.Mobile.Shared" xmlns:extensions="clr-namespace:SynapWare.Extensions.MarkupExtensions;assembly=SynapWare.Mobile.Shared" xmlns:behaviors="clr-namespace:SynapWare.Behaviors;assembly=SynapWare.Mobile.Shared" xmlns:controls="clr-namespace:SynapWare.Controls;assembly=SynapWare.Mobile.Shared" xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms" x:Class="SynapWare.Views.LoginView" BackgroundColor="{StaticResource LoginBackgroundColor}" base:ViewManager.AutoWireViewModel="true" NavigationPage.HasNavigationBar="False" Title="{extensions:Translate LogIn}"> <ContentPage.ToolbarItems> <controls:HideableToolbarItem Order="Primary" Text="{extensions:Translate ChangeTenant}" Command="{Binding ChangeTenantCommand}" IsVisible="{Binding IsMultiTenancyEnabled}" ParentPage="{x:Reference LoginPage}" /> </ContentPage.ToolbarItems> <ContentPage.Content> <ScrollView> <Grid RowDefinitions="0.10*, 150, auto, auto, 0.20*" ColumnDefinitions="*, 18*, *" RowSpacing="0" ColumnSpacing="0"> <Image Grid.Row="1" Grid.Column="1" Aspect="AspectFit" Source="{extensions:ImageSource 'SynapWare.UI.Assets.Images.Synap_Black_Teal.png'}"> </Image> <!--<Frame Grid.Row="2" Grid.Column="1" IsVisible="{Binding IsMultiTenancyEnabled}" Style="{StaticResource RoundedFrame}"> <Grid Padding="0" ColumnSpacing="5" RowSpacing="0" HorizontalOptions="Center"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.5*"/> </Grid.ColumnDefinitions> <Label Grid.Row="0" Grid.Column="0" LineBreakMode="WordWrap" Text="{extensions:Translate CurrentTenant}" /> <Label Grid.Row="0" Grid.Column="1" LineBreakMode="WordWrap" Text="{Binding CurrentTenancyNameOrDefault}" Style="{StaticResource ActiveLabel}"/> </Grid> </Frame>--> <Frame Grid.Row="3" BackgroundColor="White" BorderColor="White" Grid.Column="1" Style="{StaticResource RoundedFrame}"> <StackLayout VerticalOptions="StartAndExpand" Spacing="0"> <Label Text="{extensions:Translate UserNameOrEmail}" TextColor="{StaticResource PrimaryColor}" /> <Entry Text="{Binding UserName, Mode=TwoWay}" Keyboard="{StaticResource NoCapitalizationKeyboard}" x:Name="UsernameEntry"/> <Label Text="{extensions:Translate Password}" Margin="0,10,0,0" TextColor="{StaticResource PrimaryColor}" /> <Entry IsPassword="True" Text="{Binding Password, Mode=TwoWay}" Keyboard="{StaticResource NoCapitalizationKeyboard}" x:Name="PasswordEntry"/> <Label Text="{extensions:Translate ForgotPassword}" FontSize="Micro" HorizontalOptions="EndAndExpand" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0"> <Label.GestureRecognizers> <TapGestureRecognizer Command="{Binding ForgotPasswordCommand}" /> </Label.GestureRecognizers> </Label> <buttons:SfButton Text="{extensions:Translate LogIn}" x:Name="LoginButton" Margin="0,20,0,0" IsEnabled="{Binding IsLoginEnabled}" Style="{StaticResource ActionButton}" Command="{Binding LoginUserCommand}" CornerRadius="25"/> <!--<Label Text="{extensions:Translate EmailActivation}" HorizontalOptions="StartAndExpand" TextColor="{StaticResource PrimaryColor}" Margin="0,10,0,0"> <Label.GestureRecognizers> <TapGestureRecognizer Command="{Binding EmailActivationCommand}" /> </Label.GestureRecognizers> </Label>--> <!--<Picker Title="{extensions:Translate Languages}" Margin="0,10,0,0" ItemsSource="{Binding Languages}" ItemDisplayBinding="{Binding DisplayName}" SelectedItem="{Binding SelectedLanguage}"/>--> </StackLayout> </Frame> </Grid> </ScrollView> </ContentPage.Content> <ContentPage.Behaviors> <behaviors:EventHandlerBehavior EventName="Appearing"> <behaviors:ActionCollection> <behaviors:InvokeCommandAction Command="{Binding PageAppearingCommand}" /> </behaviors:ActionCollection> </behaviors:EventHandlerBehavior> </ContentPage.Behaviors> </ContentPage>