After switching to Android API 34 in my Xamarin android project,I get the error one of receiver_exported or receiver_not_exported should be specified

After switching to Api 34 in my Xamarin android project, I get the error ‘one of receiver_exported or receiver_not_exported should be specified when a receiver isn’t being registered exclusively for system broadcasts’.

IntentFilter filter = new IntentFilter(Intent.ActionRun);

        if (Build.VERSION.SdkInt >= BuildVersionCodes.Tiramisu)
        {
            Context context = Android.App.Application.Context;
            //IntentFilter filter = new IntentFilter(Intent.ActionRun);

            ContextCompat.RegisterReceiver(this,consoleCmdReceiver, filter, ContextCompat.ReceiverExported);
        }
        else
        {
            RegisterReceiver(consoleCmdReceiver, filter);
        }

        if (Build.VERSION.SdkInt >= BuildVersionCodes.Tiramisu)
        {
            // Eğer API 33 ve sonrası ise `ToastNotification`'ı initialize etmeden önce gerekli flag'i ekleyin
            //ToastNotification.Init(this );  // veya ReceiverNotExported
        }
        else
        {
            ToastNotification.Init(this);
        }

It gives this error in the ToastNotification.Init(this); section: ‘one of receiver_exported or receiver_not_exported should be specified when a receiver isn’t being registered exclusively for system broadcasts’.

Does specifying receiver_not_exported resolve the issue?

Actually, when I researched it, it seems to solve the problem, but I guess I can’t fully record the broadcast.

[BroadcastReceiver(Enabled = true, Exported = false)]
public class MyBroadcastReceiver : BroadcastReceiver
{
public override void OnReceive(Context context, Intent intent)
{
if (intent.Action == Intent.ActionRun)
{
// İstediğiniz işlemleri burada yapabilirsiniz
Android.Util.Log.Info(“ConsoleCmdReceiver”, “Received RUN intent”);

            string message = intent.GetStringExtra("message");
            Android.Util.Log.Info("ConsoleCmdReceiver", $"Received message: {message}");

            Toast.MakeText(context, "Broadcast received!", ToastLength.Short).Show();
        }
    }
}

Another solution was that Xamarin Essentials 1.8.1 solved the problem. But mine is already up to date (1.8.1)
https://www.couchbase.com/forums/t/xamarin-app-android-cannot-connect-on-target-api-34/38751/3

This doesn’t seem related to Couchbase. Could you clarify?