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

[Bug] NullReferenceException is thrown after CapturePhotoAsync #1397

@fronttag

Description

@fronttag

Description

A NullReferenceException is thrown after taking a picture with CapturePhotoAsync. The camera app is shown, a picture can be taken. But after accepting the picture the error occurs.

Steps to Reproduce

  1. Take a picture
  2. Accept the picture
  3. NullReferenceException is thrown from Xamarin.Essentials

09-28 09:30:51.173 I/MonoDroid( 2663): UNHANDLED EXCEPTION:
09-28 09:30:51.175 I/MonoDroid( 2663): System.NullReferenceException: Object reference not set to an instance of an object.
09-28 09:30:51.175 I/MonoDroid( 2663): at Xamarin.Essentials.IntermediateActivity.OnActivityResult (System.Int32 requestCode, Android.App.Result resultCode, Android.Content.Intent data) [0x00041] in D:\a\1\s\Xamarin.Essentials\Platform\Platform.android.cs:458
09-28 09:30:51.175 I/MonoDroid( 2663): at Android.App.Activity.n_OnActivityResult_IILandroid_content_Intent_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 requestCode, System.Int32 native_resultCode, System.IntPtr native_data) [0x00013] in /Users/builder/azdo/_work/287/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-28/mcw/Android.App.Activity.cs:2373
09-28 09:30:51.175 I/MonoDroid( 2663): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.8(intptr,intptr,int,int,intptr)

Expected Behavior

Picture is selected without exception

Actual Behavior

NullReferenceException is thrown.

Basic Information

  • Version with issue: 1.6.0-pre2
  • Last known good version: NA
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:
    • iOS: NA
    • Android: Android 10.0
    • UWP: NA
  • Android Support Library Version: NA
  • Nuget Packages:
  • Affected Devices: Motorola AOSP on shama (Android 5.1 - API 22) (on nox emulator)

Screenshots

Reproduction Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions