question

TF-4732 avatar image
0 Votes"
TF-4732 asked RobCaplan edited

Shell.CurrentItem should not be null (iOS Xamarin Forms)

I have a Xamarin Forms project which allows the user to login, and then they are redirected. On Andoid, all works fine, but on iOS I am getting an error: System.InvalidOperationException: 'Shell CurrentItem should not be null'

My code in ,y LoginViewModel (after the user has successfully logged in) is:

Application.Current.MainPage = new AppShell(); //this causes the exception in iOS only
await Shell.Current.GoToAsync($"//dashboard"); //this line is not hit

dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @TF-4732 How do you created the Shell project? Do you use the 'Flyout' template? Could you please post more details about the probem and share a realted code to reproduce the issue? What's the version fo the Xamarin.Forms package? Try to update it to the lastest stable version and test again.

0 Votes 0 ·

Hi, yes its the flyout template.

0 Votes 0 ·

Please share more details about the above questions and share the related code or a repro demo.

0 Votes 0 ·

0 Answers