[Bug] Xamarin forms android throw null exception after updating Xamarin forms to 5.0.0.2401 #15352
Comments
Hey there, thanks for the report, it would be great if you could get us a little reproduction of this issue. The information here is a bit thin to go on and will make it harder to diagnose a potential issue. |
I can confirm this is happening in our project too after updating to
|
Google matched the exception listed here while I was looking for information on an error I am having when I add:
to a Content page in a Xamarin solution. Here's the output:
I am using Visual Studio 2022 with the x86_64 emulator. I was under the impression it was an issue with SkiaSharp/OpenGL though? |
Hello, Also, google linked me here searching for the bwlo error from the Mono RT. I am able to reproduce this with a a new Shell Content that has 3 pages. First page, has a set of buttons, 2nd, the Camera2 view, and third another list of settings. When navigating the first time to the 'Camera2' page, it seems fine. But then going back to first, then again to the Camera2 page, this exception is consistently always being thrown now. However, this also occurs from going back and forth between page 1 and 3, so not the page with the Camera2 control on it...
Running Xamarin Forms 5.0.0.2337 Updated
to
It's strange, but the app i can navigate quickly between pages now and it seems almost stable, while testing now, it's more rare that it crashes with the same error, than before. |
I sometimes have the same issue (same stacktrace) when navigating between pages although I can not really reproduce it at will. I am not sure what started this issue. I am not using Shell but FreshMvvm for my navigation. It seems some timing issue or something because if you move slow between the pages it is no issue. When I Googled the error I came across this bug report so I looked into my logging and it started a day after I upgraded to XF 5.0.0.2401 so I think it might be related to this upgrade. I will go back to XF 5.0.0.2337 for now to see if it cures this issue. Logging from appcenter: Error: Stacktrace: |
Is anyone here also using any specific controls on this page, i'm finding that when i comment out all the UI on my page, everything works ok. I then start to uncomment UI elements, and find the TabBar from 'clr-namespace:Syncfusion.XForms.TabView;assembly=Syncfusion.SfTabView.XForms' does start to cause issues... |
Ohh that is interesting information, I am using Syncfusion controls too! Although I am not using the SfTabView I am using version 20.0.1.57 of Buttons, SfAutocomplete and SfPdfViewer. |
I've just updated to their latest today, and found much more stability, and that above error is no longer there. I now am using 20.1.0.59, prior to todays' update, i was using 18.x.x.x. hahaha.. so a bit of a jump, but the upgrade worked fine and no hassles :) |
Hmm I will upgrade to 20.1.0.59 and see if it fixes this issue. @zerokewl88 Good observations! |
XF 5.0.0.2478 in combination with Syncfusion 20.1.0.59 still crashes on me :( |
Just double checked again, and my XForms, i'm using 5.0.0.2401 - this seems stable for me, yet to have it crash once. It's going out to Acceptance Testing soon, so will have more users available to try crash it. Will report back if i get a crash... XForms 5.0.0.2401 |
This is an issue in the Xamarin.Android version distributed with VS 17.2 branch. In all case, if we have this issue it is caused be an exception in Android that will need to be fixed (either on Xamarin side or User code side), but for now we can't know the real cause before this fix has been released. |
@kvpt , Thank you for this valuable information because I was really in the dark with this issue. The problem is that I installed the latest VS update but I need to release a new version of my app with a very important bugfix. But now I can not because it will introduce this issue to my users so I am stuck right now. What would be the best solution to circumvent this issue until there is a fix available? The only thing I can think of is to uninstall VS and somehow download and install the latest VS 17.1 version? Is this possible or are there better solutions? Or is this a debug problem only? |
Same issue as @michelmoorlag and @zerokewl88, seeing this runtime error in Xamarin.Android app with some embedded Xamarin.Forms pages (created using |
Any workaround? |
I'm still getting this error.. |
Workaround for error: "[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object." |
This is not a workaround for me... added the lines of code and app still crashed |
Receiving following error while navigating pages on Android Emulator. Visual Studio 2022, v17.2.5 on windows. I'm Xamarin.Forms 5.0.2401 also tried 2515 but same error. System.NullReferenceException: Object reference not set to an instance of an object. at Android.Runtime.JNINativeWrapper._unhandled_exception (System.Exception e) [0x0000e] in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12 Anyone found any work around ? |
Receiving this error as well on Android. VS 2022, v17.2.6 on Windows, Xamarin Forms v5.00.2337 System.NullReferenceException: 'Object reference not set to an instance of an object.' [mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object. Any workaround yet? |
This is what you can try -
Actually, I was having same issue... The error is was something different and Android throwing JNINavtiveWrapper exception. |
Hi, anyone who solve or have a work around on this? im having the same issue |
In theory the fix is included in the latest Xamarin Android version shipped with Visual Studio 17.3 branch. |
What a problem... |
While trying to open camera using Xamarin Android Camera2 API, the app getting crash.
Expected Behavior
Open Camera without any crash
Code Snippet
//Camera2 API Android
cameraManager.OpenCamera(cameraId, mStateCallback, null);
Actual Behavior
App getting crash
Basic Information
Environment
Visual Studio 2022
Build Logs
at Android.Runtime.JNINativeWrapper._unhandled_exception (System.Exception e)
[0x0000e] in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V (_JniMarshal_PPL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0)
[0x0001d] in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:111
at (wrapper native-to-managed) Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(intptr,intptr,intptr)
The text was updated successfully, but these errors were encountered: