While debugging, I uninstalled and installed my app, and the following exception appeared:
JniException (Exception in Java code called through JNI: javax.crypto.AEADBadTagException
...
android.security.KeyStoreException: Signature/MAC verification failed
...
After some investigation, I found that Android's backup policy is the culprit. It tries to back up old data, and since these cryptographic keys do not match, this error occurs.
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude <!-- What to place here ??? --> />
</full-backup-content>
This issue asks to get better documentation for this. I also want to ask how to solve this using Option 2, as I don't know what to exclude. Additionally, is it possible to add this exclude directive directly to the dependency itself?
While debugging, I uninstalled and installed my app, and the following exception appeared:
After some investigation, I found that Android's backup policy is the culprit. It tries to back up old data, and since these cryptographic keys do not match, this error occurs.
For more context, a similar issue is discussed in this package: flutter_secure_storage#43.
Currently, there are two ways to fix this:
Option 1: Disable backup completely:
Option 2: Keep backup enable but exclude encrypted data used by this plugin:
This issue asks to get better documentation for this. I also want to ask how to solve this using Option 2, as I don't know what to exclude. Additionally, is it possible to add this exclude directive directly to the dependency itself?