我正在使用 Xamarin Forms,并且根据 Google Play 商店要求 ( https://developer.android.com/google/play/requirements/target-sdk ) 需要将 Android SDK 级别从 11 升级到 12。我已向所有 Activity 、服务和应用程序中使用的接收器。还更新了 PendingIntent 标志的可变性。但是,当我运行该应用程序时,我收到错误。
~/Droid/obj/Debug/AndroidManifest.xml(5,5): Error AMM0000: /~Droid/obj/Debug/lp/95/jl/AndroidManifest.xml Warning: Namespace 'com.google.android.gms.analytics' used in: AndroidManifest.xml, AndroidManifest.xml. android:exported needs to be explicitly specified for element <service#crc643a9353f6fb65c51a.FirebaseService>. 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/Debug/lp/95' is from 'Xamarin.GooglePlayServices.Analytics.Impl.dll'.
/~Droid/obj/Debug/AndroidManifest.xml(5,5): Error AMM0000: android:exported needs to be explicitly specified for element <service#crc643a9353f6fb65c51a.FirebaseIdService>. 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.
/~Droid/obj/Debug/AndroidManifest.xml(5,5): Error AMM0000: 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.
下面是我的应用程序中使用的 Nuget 包。
关于如何解决此问题有什么建议吗?
最佳答案
这对您不起作用的明确原因是您的 Firebase 库,它们确实很古老。我很惊讶您在 Android 11 之前仍未遇到任何问题。
解决此问题的最佳方法是将以下库至少升级到以下版本:
Xamarin.Firebase.Analytics 120.0.1
Xamarin.Firebase.Analytics.Impl 116.3.0
Xamarin.Firebase.Messaging 123.0.3
关于c# - 在 Xamarin Forms 中将 Android API 目标级别从 11 升级到 12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73878519/