Hello,
It appears to be a bug. And this issue has been reported it at MAUI github repo, please see:Adding a Connectivity.ConnectivityChanged handler throw an exception on Android 14 #17861
This issue has been fixed, but New .NET MAUI version do not been released. Please track on this issue by above github link.
By the way, here is a workaround, you can change the android target-framework to android 13 manually, this issue will disappear when you run it in android 14 devices or emulator.
Open you AndroidManifest.xml
file, add <uses-sdk android:targetSdkVersion="33" />
in the <manifest >
tag like following simple code.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
add here
<uses-sdk android:targetSdkVersion="33" />
</manifest
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.