dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

MAUI 8.0.82 raises on Android Javax.Crypto.AEADBadTagException #24986

Open erossini opened 1 month ago

erossini commented 1 month ago

Description

I have my .NET 8 MAUI application and I tried to deploy it on a real Android device after updating MAUI to the version 8.0.82

When the application starts I get this error

Javax.Crypto.AEADBadTagException

image

I understood the error comes from changes from the SecurityStorage in the Maui Essentials. On GitHub, I read that the workaround is to set to False in the AndroidManifest the backup like that

<application android:allowBackup="false" 
        android:fullBackupContent="@xml/auto_backup_rules" 
        android:icon="@mipmap/appicon" android:supportsRtl="true" 
        android:label="Language In Use" 
        android:dataExtractionRules="@xml/appcenter_backup_rule">

but I continue to receive the message and I can't run the application. Checking the preview documentation, I read I have to update also the auto_backup_rules.xml like the following

<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
        <include domain="sharedpref" path="."/>
        <exclude domain="sharedpref" 
                 path="${applicationId}.microsoft.maui.essentials.preferences.xml"/>
</full-backup-content>

but it is not working. How can I fix this issue?

Public API Changes

Looking around, this could be related to the SecurityStorage.

Intended Use-Case

When the application starts, this error is immediately raised by the app only in Android.

I saw a few posts but none of them offer a solutions. For example:

similar-issues-ai[bot] commented 1 month ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

AramMar commented 2 weeks ago

I have the same issue on A25. On other phones work

jaosnz-rep commented 5 days ago

@erossini @AramMar Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!