MAUI Android Javax.Crypto.AEADBadTagException

Enrico Rossini 201 Reputation points
2024-09-29T00:05:56.04+00:00

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

enter image description here

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>

This workaround is not working. How can I fix this issue?

Developer technologies | .NET | .NET MAUI
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.