Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes on Android & iOS with Null Reference Exception When Using CameraView Inside The49.Maui.BottomSheet #42

Open
srpai746 opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@srpai746
Copy link

Description

When calling ShowAsync() on a BottomSheet object from The49.Maui.BottomSheet, the app crashes on both Android and iOS with the following error:

System.NullReferenceException: 'Object reference not set to an instance of an object.'

Stack Trace (Excerpt)

0xFFFFFFFFFFFFFFFF in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception  
0x1A in Android.Runtime.JNINativeWrapper._unhandled_exception  
0x1D in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V  
...  
0xC in Android.App.SyncContext.  
0xE in Java.Lang.Thread.RunnableImplementor.Run  
0x8 in Java.Lang.IRunnableInvoker.n_Run  

Expected Behavior

The BottomSheet should open without crashing, and CameraView should function correctly inside it.

Findings

  • Works fine if CameraView is placed inside a ContentPage instead of BottomSheet.
  • The issue might be related to lifecycle handling, missing context, or rendering limitations inside BottomSheet.

Environment

  • .NET MAUI Version: net8.0
  • CameraScanner.Maui Version: 1.4.19
  • The49.Maui.BottomSheet Version: 8.0.3
  • Devices Tested:
    • Samsung Galaxy S23 (Android)
    • iPhone 14 (iOS)

Steps to Reproduce

  1. Download the source code of sample app attached
  2. Run the sample app in any Android or iOS device
  3. Click on Request Camera Permission and grant permission to camera usage
  4. Click on QR Code Scanner button

Expected Behavior

  • The BottomSheet should open, and the CameraView should function correctly.

Actual Behavior

  • The app crashes with a NullReferenceException.

Basic Information

  • Version with issue: 1.4.19
  • Last known good version: none

Screenshots, Attachments, Links

Source code for sample app with reproducing the issue is attached

CameraDemoApp.zip

@srpai746 srpai746 added the bug Something isn't working label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant