Skip to content

System.MethodAccessException MAUI app startup crash #3975

@plequere-ms

Description

@plequere-ms

Package

Sentry

.NET Flavor

.NET

.NET Version

9.0.0

OS

Android

SDK Version

5.1.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

Since upgrading Sentry.Maui from 5.1.0 to 5.1.1, I am occasionally seeing the following crash:

System.MethodAccessException: Method Android.Runtime.AndroidEnvironmentInternal.UnhandledException(System.Exception)' is inaccessible from method Sentry.JavaSdk.SentryOptions+IBeforeSendCallbackInvoker.n_Execute_Lio_sentry_SentryEvent_Lio_sentry_Hint__mm_wrapper(intptr,intptr,intptr,intptr)'

Unfortunately, I don't have a good repro. This only happens occasionally. Empirical evidence seems to suggest that this might have something to do with network conditions, but that's merely a guess.

My app builds with the following settings, which might be relevant:

    <!-- Trim settings -->
    <TrimMode>partial</TrimMode>
    <IsTrimmable>true</IsTrimmable>
    <TrimOptimization>release</TrimOptimization>

Please let me know if I can provide any additional information.

Expected Result

No crash :)

Actual Result

App crashes immediately upon startup.

https://sound-imagineers-llc.sentry.io/issues/6306102051/?project=4503996749643777&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&referrer=issue-stream&statsPeriod=90d&stream_index=0

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions