I have tested my android app in debug mode on android devices it's working fine but it is crashing in release mode. It is giving me the following error in the Device Log:
java.lang.NoSuchFieldError: no "Landroidx/security/crypto/EncryptedSharedPreferences$PrefKeyEncryptionScheme;" field "AES256_SIV" in class "Landroidx/security/crypto/EncryptedSharedPreferences$PrefKeyEncryptionScheme;" or its superclasses
I have tried to make change in proguard.cfg as it is suggested in the following Link
-keep class android.support.v4.widget.Space { *; }
-dontwarn android.support.v4.widget.Space
-keepmembers public class androidx.security.crypto.** {
public <fields>;
}
But still it is not working. I have no clue how to fix this any suggestions?
The steps I have taken to resolve this error are:
proguard.cfg
file in "Project/Platforms/Android/" in your file system.ProguardConfiguration
: <ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<ProguardConfiguration Include="Platforms\Android\proguard.cfg" />
</ItemGroup>
proguard.cfg
file, add the following lines (you may be able to use less broad rules like in your original post but I have not tested this):-keep class androidx.security.crypto.** { *; }
-keep class com.google.crypto.tink.** { *; }