microsoft-authentication-library-for-android icon indicating copy to clipboard operation
microsoft-authentication-library-for-android copied to clipboard

Proguard error when try to catch MsalUiRequiredException

Open thaworn-li opened this issue 2 years ago • 2 comments

Hi, I have a problem when try to build released app with proguard enable. we found an error like this when R8 minifiy

Missing class com.google.crypto.tink.subtle.Ed25519Sign$KeyPair (referenced from: com.nimbusds.jose.jwk.OctetKeyPair com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator.generate()) Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts) Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts) Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts) Missing class edu.umd.c

Screenshot 2566-10-07 at 01 14 27

thaworn-li avatar Oct 06 '23 18:10 thaworn-li

Hi @thaworn-li Can you please share the following:

  • Device: [e.g. Pixel, OnePlus 6, etc]
  • Android Version: [e.g. API Level, Build Number]
  • MSAL Version

This needs further investigation from our side in order to confirm you.

negoe avatar Oct 16 '23 23:10 negoe

Hi @negoe. Sorry to answer you late.

I try to build .aab release version to publish to playstore.

Here is my config in android project

  • const val SDK_MIN = 23 const val SDK_TARGET = 33 const val SDK_COMPILE = 33 JAVA_VERSION = JavaVersion.VERSION_11
  • MSAL version = 4.9.0

Here is the code that causes proguard failure. If I remove this code, It will be work fine.

image

Build error message Missing class com.google.crypto.tink.subtle.Ed25519Sign$KeyPair (referenced from: com.nimbusds.jose.jwk.OctetKeyPair com.nimbusds.jose.jwk.gen.OctetKeyPairGenerator.generate()) Missing class com.google.crypto.tink.subtle.Ed25519Sign (referenced from: com.google.crypto.tink.subtle.Ed25519Sign com.nimbusds.jose.crypto.Ed25519Signer.tinkSigner and 2 other contexts) Missing class com.google.crypto.tink.subtle.Ed25519Verify (referenced from: com.google.crypto.tink.subtle.Ed25519Verify com.nimbusds.jose.crypto.Ed25519Verifier.tinkVerifier and 2 other contexts) Missing class com.google.crypto.tink.subtle.X25519 (referenced from: com.nimbusds.jose.JWECryptoParts com.nimbusds.jose.crypto.X25519Encrypter.encrypt(com.nimbusds.jose.JWEHeader, byte[]) and 2 other contexts) Missing class edu.umd.cs.findbugs.annotations.NonNull (referenced from: java.util.Map com.microsoft.identity.common.java.challengehandlers.PKeyAuthChallenge.getChallengeHeaderWithSignedJwt(com.microsoft.identity.common.java.challengehandlers.IDeviceCertificate) and 13 other contexts) Missing class edu.umd.cs.findbugs.annotations.Nullable (referenced from: android.app.Activity com.microsoft.identity.common.internal.platform.AndroidPlatformUtil.mActivity and 296 other contexts) Missing class edu.umd.cs.findbugs.annotations.SuppressFBWarnings (referenced from: boolean com.microsoft.identity.common.crypto.AndroidWrappedKeyLoader.sSkipKeyInvalidationCheck and 72 other contexts)

image

thaworn-li avatar Oct 19 '23 03:10 thaworn-li

If you are still seeing this issue with more current versions of MSAL, please reach out to your Microsoft representative, and they will create a support ticket. Thank you.

melissaahn avatar Feb 27 '25 04:02 melissaahn