Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error en Android 12 (API level 31) FLAG_IMMUTABLE or FLAG_MUTABLE #1

Open
Rigo09 opened this issue Jul 27, 2023 · 1 comment
Open

Comments

@Rigo09
Copy link

Rigo09 commented Jul 27, 2023

Hola! muchas gracias por tu aporte @acaliaro, en este momento intenté probarlo y me generaba el error:
Java.Lang.IllegalArgumentException: 'com.companyname.mauiapptestnfcandroid: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.'

para solucionarlo sustituí en el MainActivity.cs
var pendingIntent = PendingIntent.GetActivity(this, 0, intent, 0);
por
var pendingIntent = PendingIntent.GetActivity(this, 0, intent, PendingIntentFlags.Immutable);

@Rigo09
Copy link
Author

Rigo09 commented Jul 27, 2023

Hi @acaliaro I'm learning from your project MauiAppTestNfcAndrid. I'm new to .net development and I working with a .net Maui Blazor type project . I tried to test the application but still don't have the ReadPage view and its viewmodel. My question is the following: From the XamarinDemoNFC project, can I bring the pages that already existed, for example ReadPage.xaml, and add them to the Maui project to test reading an NFC tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant