Description
Description
There's not much to go on here, except sentry.io capturing a segfault early in the application startup on numerous devices (Armor X7 Pro, Pixel 8, Honor X7, Pixel 6 Pro and others, across all Android versions.
The app is generally running okay, so it seems there's some network event causing it to be triggered which is making it hard to capture.
Steps to Reproduce
There's none of the usual sentry.io tracking for my app present, so it seems to crash early during the app lifecycle, always just after capturing a network event NETWORK_CAPABILITIES_CHANGED
I am using the MAUI Essentials, primarily the Connectivity.ConnectivityChanged event.
I don't know whether it's related, but I have also noticed previously that registering as a listener sometimes fails too on some devices, because I've witnessed crashes when registering the line marked <<<<<<
try
{
Connectivity.ConnectivityChanged += Current_ConnectivityChanged; <<<<<<
Logger.Log(_this, "PageManager - listening for ConnectivityChanged events");
}
catch (Exception e)
{
Logger.Log(_this, $"PageManager - TODO - UNABLE TO LISTEN FOR CONNECTIVITYCHANGED EVENTS reason {e.Message}");
}
The error was
Exception has occurred: CLR/Java.Lang.SecurityException
An unhandled exception of type 'Java.Lang.SecurityException' occurred in Mono.Android.Runtime.dll: 'com.devology.myteamsafe.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts'
Inner exceptions found, see $exception in variables window for more details.
Innermost exception Android.OS.RemoteException : Remote stack trace:
at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16580)
at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11530)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2928)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3195)
at android.os.Binder.execTransactInternal(Binder.java:1375)
<Cannot evaluate the exception stack trace>
As far as I know essentials should be doing this behind the scenes anyway? For example in the obj folder I do see manifests with
<permission android:name="com.devology.myteamsafe.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" android:protectionLevel="signature" />
<uses-permission android:name="com.devology.myteamsafe.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" />
Like I say, I'm not sure whether that's related or not to the crashes.
Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
No response
Affected platforms
Android
Affected platform versions
Armor X7 Pro, Pixel 8, Honor X7, Pixel 6 Pro and others, across all Android versions.
Did you find any workaround?
None - its a segfault that kills the app
Relevant log output
No response