Android and AWS Cognito - Unable to unmarshall error response with proguard

After trying different Proguard settings, following is the minimal configuration, additional to that suggested on AWS SDK repository, to make it work

-keep class com.amazonaws.services.cognitoidentityprovider.** { *; }

it must be added to app/proguard-rules.pro


Unmarshalling errors can also occur with classes in the AWS core library, not just com.amazonaws.services.cognitoidentityprovider. This rule will prevent this crash for all AWS lib exceptions:

-keep class * extends com.amazonaws.AmazonClientException { *; }