Skip to content

Xamarin Android: System.NullReferenceException on any exception thrown inside Task #7102

Closed

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


If we try to throw any exception inside a Task and not catch it, the original exception is lost and NullReferenceException is raised instead. If we try to catch the exception, it works properly.
This behavior is not observed in VS2019, it works properly there with this same project.

Attached Screenshot provides all the necessary information.

Stack trace output:
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)


Original Comments

Feedback Bot on 6/14/2022, 01:32 AM:

(private comment, text removed)


Original Solutions

(no solutions)

Activity

  1. jpobst commented on Jun 16, 2022

    @jpobst
    Contributor

    Possible duplicate of #7085?

  2. jonathanpeppers commented on Jun 16, 2022

    @jonathanpeppers
    Member

    Yeah, I think this will be fixed by: #7103

  3. ghost locked as resolved and limited conversation to collaborators on Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions