xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Bug] Issue in build when changing the target version to API 31 in android #15678

Closed g-sharat closed 1 year ago

g-sharat commented 1 year ago

Description

I wanted to change the target version to update the app on stores and changed my target framework version to 31 and compile version to Android 12 as well but the build fails with the below exception android:exported needs to be explicitly specified for element <receiver#crc64df999be563077fc4.BootReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

I have checked the whole android project and added the Exported = true to all the services and receivers but the issue persists. I am not sure where the BootReceiver is coming from and what service is using this. If anyone has any insight on this problem or how to trace this issue would be appreciated.

Steps to Reproduce

  1. Change the targetversion to 31 and compileversion to Android 13

Expected Behavior

Build should be successful

Actual Behavior

Build fails with exception

Basic Information