This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.
[Bug] Shell: NullReferenceException after closing the app #7436
Closed
Description
Description
Note that this occurs under android 8.1 (api 27) on a physical smartphone.
After the shell is closed, a NullReferenceException
is thrown at renderer context.
Steps to Reproduce
- Open Visual Studio and create a Xamarin Forms Shell app. I checked out Android and IOs.
- Run the app. In my case, I ran it in a real device.
- When the App Shell finishes loading, press physical back button.
Expected Behavior
The app should be closed without any issue.
Actual Behavior
A NullReferenceException
exception is thrown outside user code.
Basic Information
- Version with issue: 4.2.0.709249
- Last known good version: 4.1.0.709244 (not tested any intermediate versions)
- IDE: Visual Studio 2019 (Preview 3.3)
- Platform Target Frameworks:
- iOS: Not tested
- Android: SDK version 28
- Not tested.
- Android Support Library Version:
- Nuget Packages: Xamarin.essentials (1.2.0) and Xamarin.Forms (4.2.0.709249).
- Affected Devices: Samsung Galaxy J7 Prime (SM-G610M)
Screenshots
This is the logcat output from Visual Studio's output window:
09-08 13:00:36.891 D/Mono ( 9392): DllImport attempting to load: '/system/lib/liblog.so'.
09-08 13:00:36.895 D/Mono ( 9392): DllImport loaded library '/system/lib/liblog.so'.
09-08 13:00:36.895 D/Mono ( 9392): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
09-08 13:00:36.895 D/Mono ( 9392): Searching for '__android_log_print'.
09-08 13:00:36.895 D/Mono ( 9392): Probing '__android_log_print'.
09-08 13:00:36.895 D/Mono ( 9392): Found as '__android_log_print'.
09-08 13:00:36.911 I/MonoDroid( 9392): UNHANDLED EXCEPTION:
09-08 13:00:36.916 I/MonoDroid( 9392): System.NullReferenceException: Object reference not set to an instance of an object.
09-08 13:00:36.916 I/MonoDroid( 9392): at Xamarin.Forms.Platform.Android.ShellSectionRenderer.UnhookEvents () [0x00022] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ShellSectionRenderer.cs:254
09-08 13:00:36.916 I/MonoDroid( 9392): at Xamarin.Forms.Platform.Android.ShellSectionRenderer.OnDestroy () [0x00008] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ShellSectionRenderer.cs:180
09-08 13:00:36.916 I/MonoDroid( 9392): at Android.Support.V4.App.Fragment.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <96541ba8a6104b52aadf4218488f978c>:0
09-08 13:00:36.917 I/MonoDroid( 9392): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.45(intptr,intptr)
09-08 13:00:36.937 W/zygote ( 9392): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
09-08 13:00:36.944 D/Mono ( 9392): DllImport searching in: '__Internal' ('(null)').
09-08 13:00:36.944 D/Mono ( 9392): Searching for 'java_interop_jnienv_throw'.
09-08 13:00:36.944 D/Mono ( 9392): Probing 'java_interop_jnienv_throw'.
09-08 13:00:36.944 D/Mono ( 9392): Found as 'java_interop_jnienv_throw'.
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'
Thread finished: <Thread Pool> #3
El subproceso 0x3 terminó con código 0 (0x0).
Thread finished: <Thread Pool> #4
El subproceso 0x4 terminó con código 0 (0x0).
09-08 13:01:17.626 I/MonoDroid( 9392): UNHANDLED EXCEPTION:
=================================================================
Native Crash Reporting
09-08 13:01:17.629 I/MonoDroid( 9392): System.NullReferenceException: Object reference not set to an instance of an object.=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0xefc17e36):0xefc17e26 78 44 00 68 00 68 03 90 20 46 e7 f7 8e fd 05 46 xD.h.h.. F.....F
0xefc17e36 e8 68 01 30 00 f0 bc 80 28 68 00 6c 10 f4 80 2f .h.0....(h.l.../
0xefc17e46 68 48 18 bf ad 69 78 44 01 78 28 68 41 b1 1d ee hH...ixD.x(hA...
0xefc17e56 70 1f c9 69 21 b1 49 6b 00 29 18 bf 1e f5 65 f8 p..i!.Ik.)....e.
=================================================================
Managed Stacktrace:
==============================================================
09-08 13:01:17.629 I/MonoDroid( 9392): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.45(intptr,intptr)===
at <unknown> <0xffffffff>
at Java.Interop.NativeMethods:java_interop_jnienv_new_string <0x00043>
at Strings:NewString <0x0008f>
at Strings:NewString <0x001c3>
at Android.Runtime.JNIEnv:NewString <0x000cb>
at Java.Lang.Error:.ctor <0x0014f>
at Android.Runtime.JavaProxyThrowable:.ctor <0x00083>
at Java.Lang.Throwable:FromException <0x0016f>
at Android.Runtime.AndroidEnvironment:UnhandledException <0x0046b>
at Android.Runtime.DynamicMethodNameCounter:9 <0x0008b>
at Android.Runtime.DynamicMethodNameCounter:9 <0x000bb>
=================================================================
09-08 13:01:17.629 I/MonoDroid( 9392): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.45(intptr,intptr)
09-08 13:01:17.629 I/MonoDroid( 9392): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a(intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue*)
09-08 13:01:17.629 I/MonoDroid( 9392): at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00073] in <e1eee046eba244a29bf9a92310ced851>:0
09-08 13:01:17.629 I/MonoDroid( 9392): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <e1eee046eba244a29bf9a92310ced851>:0
09-08 13:01:17.629 I/MonoDroid( 9392): at Android.App.Activity.OnDestroy () [0x0000a] in <a992511f967645e1aa1be5abb3be9fee>:0
09-08 13:01:17.630 I/MonoDroid( 9392): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x00060] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:228
09-08 13:01:17.630 I/MonoDroid( 9392): at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <a992511f967645e1aa1be5abb3be9fee>:0
09-08 13:01:17.630 I/MonoDroid( 9392): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.9(intptr,intptr)
09-08 13:01:17.699 E/mono-rt ( 9392): /proc/self/maps:
09-08 13:01:17.699 E/mono-rt ( 9392): 12c00000-12c80000 rw-p 00000000 00:01 9059 /dev/ashmem/dalvik-main space (region space)_2694_2694 (deleted)