Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Null reference exception in Shell when switching between tabs #14122

Closed
ChristopherStephan opened this issue Apr 8, 2021 · 4 comments · Fixed by #14689
Closed

[Bug] Null reference exception in Shell when switching between tabs #14122

ChristopherStephan opened this issue Apr 8, 2021 · 4 comments · Fixed by #14689
Labels
a/shell 🐚 p/iOS 🍎 s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@ChristopherStephan
Copy link

ChristopherStephan commented Apr 8, 2021

Description

We get a null reference exception in our project as well as in the Xaminals app when switching between shell tabs:

Steps to Reproduce

  1. Download Xaminals project
  2. Update Xamarin.Forms to version 4.8.0.1269
  3. Deploy Xaminals app on iOS 14.3
  4. Switch between the tabs
  5. App crashes with error:
 System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Shell.GetNavBarIsVisible (Xamarin.Forms.BindableObject obj) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Shell\Shell.cs:104
  at Xamarin.Forms.Platform.iOS.ShellSectionRenderer+NavDelegate.WillShowViewController (UIKit.UINavigationController navigationController, UIKit.UIViewController viewController, System.Boolean animated) [0x00028] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRenderer.cs:628
  at 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/14.8.0.3/src/Xamarin.iOS/UIKit/UIApplication.cs:86
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.8.0.3/src/Xamarin.iOS/UIKit/UIApplication.cs:65
  at Xaminals.iOS.Application.Main (System.String[] args) [0x00001] in /Users/destec2/Documents/xaminals/xamarin-forms-samples/UserInterface/Xaminals/Xaminals.iOS/Main.cs:12

Expected Behavior

App does not crash when navigating between tabs

Actual Behavior

App crashes when switching between the tabs

Basic Information

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.8.6 (build 15)
Installation UUID: f2862ade-ea94-46dc-80e1-8b8e0ee2217c
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000113

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit)
	Package version: 612000113

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.102/Sdks
SDK Versions:
	5.0.102
	3.1.201
	2.1.802
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.2
	3.1.8
	3.1.3
	2.1.23
	2.1.22
	2.1.13

=== .NET Core 3.1 SDK ===

SDK: 3.1.201

=== Xamarin.Profiler ===

Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.3 (17715)
Build 12C33

=== Xamarin.Mac ===

Version: 7.2.0.3 (Visual Studio Community)
Hash: c51fabee8
Branch: xcode12.3
Build date: 2020-12-10 21:05:04-0500

=== Xamarin.iOS ===

Version: 14.8.0.3 (Visual Studio Community)
Hash: c51fabee8
Branch: xcode12.3
Build date: 2020-12-10 21:05:05-0500

=== Xamarin.Android ===

Version: 11.1.0.26 (Visual Studio Community)
Commit: xamarin-android/d16-8/a36ce73
Android SDK: /Users/Shared/Development/Android/sdk
	Supported Android versions:
		8.0 (API level 26)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.4
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/Shared/Development/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:34:58 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:35:22 UTC

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Build Information ===

Release ID: 808060015
Git revision: d34d29b4643a130479d762e4d2b5750e6462fde7
Build date: 2021-01-15 08:35:04-05
Build branch: release-8.8
Xamarin extensions: d34d29b4643a130479d762e4d2b5750e6462fde7

=== Operating System ===

Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Mon Aug 31 22:12:52 PDT 2020
    root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

DeepClean 1.2.5


@ChristopherStephan ChristopherStephan added s/unverified New report that has yet to be verified t/bug 🐛 labels Apr 8, 2021
@jsuarezruiz jsuarezruiz added this to New in Triage via automation Apr 28, 2021
@rachelkang
Copy link
Contributor

Hi, @ChristopherStephan - thanks for submitting this issue. I unfortunately wasn't able to reproduce the behavior you're describing on the version of iOS and XF you specified... Can you try upgrading to 5.0 and letting me know if that changes anything? If not, could you let me know which device/emulator(s) are you experiencing this on? Thanks :)

@rachelkang rachelkang added a/shell 🐚 p/iOS 🍎 s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Apr 29, 2021
@rachelkang rachelkang moved this from New to Needs Info in Triage Apr 29, 2021
@ChristopherStephan
Copy link
Author

I was experiencing this issue on a iPhone 8 Plus simulator. Sorry, cannot re-test it with XF 5 now. Will try to find some time later.

@ChristopherStephan
Copy link
Author

I could not reproduce the issue with Xamarin.Forms 5. This could be a false positive result though since the bug is not always reproducible.

@InquisitorJax
Copy link

@jsuarezruiz
Just a heads up here - we're still getting reports of this crash on App Center, even after upgrading Forms >= 2196
Stack trace as above:
Shell.GetNavBarIsVisible (Xamarin.Forms.BindableObject obj)
ShellSectionRenderer+NavDelegate.WillShowViewController (UIKit.UINavigationController navigationController, UIKit.UIViewController viewController, System.Boolean animated)
(wrapper managed-to-native) ObjCRuntime.Messaging.objc_msgSendSuper(intptr,intptr,bool)
UIViewController.ViewWillAppear (System.Boolean animated)
ShellSectionRenderer.ViewWillAppear (System.Boolean animated)
(wrapper managed-to-native) ObjCRuntime.Messaging.objc_msgSendSuper(intptr,intptr,intptr)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shell 🐚 p/iOS 🍎 s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

3 participants