microsoft-authentication-library-for-dotnet icon indicating copy to clipboard operation
microsoft-authentication-library-for-dotnet copied to clipboard

BrowserTabActivity android:exported needs to be explicitly specified

Open TheMrChaptastic opened this issue 2 years ago • 2 comments

Xamarin.Forms [5.0.0.2515] Android Issue Microsoft.Identity.Client 4.45.0

We are updating our Xamarin Android project to target android v12.1 (API 32) from v11 to allow for new style splash screen for those users. We have had to explicitly add exported attributes to our activities and services due to this version change.

Getting an error in AndroidManifest.xml on Building/Rebuilding android:exported needs to be explicitly specified for element <activity#crc648316b0a9aa8cfd61.BrowserTabActivity>. 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.

Have tried Updating numerous Nuget Packages with the same error showing.

TheMrChaptastic avatar Sep 16 '22 20:09 TheMrChaptastic

Another todo for this is to update App Center tests and add devices for v12.1 (API 32) and v13 (API 33). We currently only have v12 and v11.

pmaytak avatar Sep 17 '22 03:09 pmaytak

@TheMrChaptastic we will test API32. In the meantime, you can take a look at the MAUI samples. They have the android:exported attributes that you mentioned. It will be great, if you can move to MAUI as it is the future.

SameerK-MSFT avatar Sep 21 '22 16:09 SameerK-MSFT

Seems like workaround exists, dropping to P2.

bgavrilMS avatar Sep 30 '22 09:09 bgavrilMS

@TheMrChaptastic we will test API32. In the meantime, you can take a look at the MAUI samples. They have the android:exported attributes that you mentioned. It will be great, if you can move to MAUI as it is the future.

Currently we are not scheduled to move to MAUI until we can verify all packages used in our app are ready to make that transition or have options to replace those packages that arent being supported in the future. So it would be extremely helpful in the meantime to have that supported tag for Xamarin in the meantime.

TheMrChaptastic avatar Sep 30 '22 13:09 TheMrChaptastic

This required fix in the samples. Created a new branch. https://github.com/Azure-Samples/active-directory-xamarin-native-v2/tree/sameerk/Bug3680. Waiting for PR approval t merge. We will also update the library as preventive mechanism in the future. However, just the change in the samples would do. This was tested in Android Emulator - Pixel 5 API 32. @TheMrChaptastic please let us know if this addressed your issue.

SameerK-MSFT avatar Oct 05 '22 23:10 SameerK-MSFT

Fixed in the samples. Merged -> ready in main. https://github.com/Azure-Samples/active-directory-xamarin-native-v2/pull/211

Fixed in the library as precaution. https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/pull/3735

SameerK-MSFT avatar Oct 07 '22 18:10 SameerK-MSFT

Xamarin.Forms [5.0.0.2515] Android Issue Microsoft.Identity.Client 4.50.0

Still i am getting the issue Severity Code Description Project File Line Suppression State Error ....\obj\Release\130\lp\102\jl\AndroidManifest.xml Warning: Namespace 'com.google.android.gms.auth.api' used in: AndroidManifest.xml, AndroidManifest.xml.

android:exported needs to be explicitly specified for element <activity#crc648316b0a9aa8cfd61.BrowserTabActivity>. 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.

Directory 'obj\Release\130\lp\102' is from 'Xamarin.GooglePlayServices.Auth.Api.Phone.dll'. Janus.Android ...\obj\Release\130\AndroidManifest.xml 49

azharuddinsayed avatar Mar 10 '23 12:03 azharuddinsayed

@SameerK-MSFT can you help me on this i am stuck while publishing my apk

azharuddinsayed avatar Mar 13 '23 12:03 azharuddinsayed