简体   繁体   English

XAMARIN.FORMS Android:针对 Android S+ 时需要设置 FLAG_IMMUTABLE

[英]XAMARIN.FORMS Android: FLAG_IMMUTABLE needs to be set when targeting Android S+

Ive seen this issue a few times now, but never for xamarin.forms:我现在已经多次看到这个问题,但从未见过 xamarin.forms:

When I am trying to deploy on android 12 I am getting:当我尝试在 android 12 上部署时,我得到:

com.interiorcircle.interiorcircledroid: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. com.interiocircle.interircircledroid:针对 S+(版本 31 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一。 Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, eg if it needs to be used with inline replies or bubbles.强烈考虑使用 FLAG_IMMUTABLE,仅当某些功能依赖于可变的 PendingIntent 时才使用 FLAG_MUTABLE,例如,如果它需要与内联回复或气泡一起使用。

Here in picture:在图片中: 在此处输入图像描述

Appearently, a flag needs to be set, but I cannot figure out where.显然,需要设置一个标志,但我不知道在哪里。

Anyone has some help here?有人在这里有帮助吗?

Install the Xamarin.AndroidX.work.runtime to remove error.安装 Xamarin.AndroidX.work.runtime 以消除错误。 See link below.请参阅下面的链接。

See the following https://stackoverflow.com/a/70157415/6902149请参阅以下https://stackoverflow.com/a/70157415/6902149

In my case following code has fixed the runtime error:在我的情况下,以下代码已修复运行时错误:

var pendingIntentFlags = (Build.VERSION.SdkInt >= BuildVersionCodes.S)
                ? PendingIntentFlags.UpdateCurrent | PendingIntentFlags.Mutable
                : PendingIntentFlags.UpdateCurrent;
var pendingActivityIntent = PendingIntent.GetActivity(Application.Context, requestCode, activityIntent, pendingIntentFlags);
var pendingIntent = PendingIntent.GetBroadcast(Application.Context, requestCode, intent, pendingIntentFlags);

If you cannot figure out where then you probably don't use PendingIntent in your code.如果您不知道在哪里,那么您可能不会在代码中使用PendingIntent

In that case it means that some of the packages that you use is using this code and they need to fix it.在这种情况下,这意味着您使用的某些包正在使用此代码,他们需要修复它。 Possibly you need to report the problem to them if they are not already aware of it.如果他们还没有意识到问题,您可能需要向他们报告问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 身份验证不适用于 Android 12,定位 S+ 需要 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - Firebase Authentication is not working on Android 12, Targeting S+ requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE Android facebook-login 库 11.2.0 崩溃 Android 12 - 定位 S+(版本 31 及更高版本)需要 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - Android facebook-login library 11.2.0 crashes Android 12 - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE MediaSessionCompat:Targeting S+(版本 31 及以上)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - MediaSessionCompat:Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent 在 Flutter 应用程序 Targeting S+(版本 31 及更高版本)中,需要在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - In flutter app Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent FacebookAds:定位 S+(版本 31 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - FacebookAds: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent 定位 S+(版本 31 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent androidTest:针对 S+(版本 31 及以上)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - androidTest: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent Xamarin Forms 目标版本 31 及以上需要 FLAG_IMMUTABLE - Xamarin Forms Targeting version 31 and above requires FLAG_IMMUTABLE 应用程序崩溃:定位 S+(版本 31 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一 - App crashes : Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent 针对 S+(版本 31 及更高版本)需要在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一吗? - Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM