Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADAL Plugin integration is crashing with proguard true #1645

Open
YormanS opened this issue Sep 20, 2021 · 1 comment
Open

ADAL Plugin integration is crashing with proguard true #1645

YormanS opened this issue Sep 20, 2021 · 1 comment

Comments

@YormanS
Copy link

YormanS commented Sep 20, 2021

Expected behavior: The release apk with proguard should launch AuthenticationActivity without any crash.(applied proguard rules as per github documentation)

Actual behavior: App is crashing with below exception
java.lang.RuntimeException: Unable to start activity ComponentInfo{**/com.microsoft.aad.adal.AuthenticationActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: com.microsoft.aad.adal.H.values []
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: com.microsoft.aad.adal.H.values []
at java.lang.Enum.enumValues(Enum.java:270)
at java.lang.Enum.access$000(Enum.java:61)
at java.lang.Enum$1.create(Enum.java:277)
at java.lang.Enum$1.create(Enum.java:275)
at libcore.util.BasicLruCache.get(BasicLruCache.java:63)
at java.lang.Enum.getSharedConstants(Enum.java:289)
at java.lang.Enum.valueOf(Enum.java:243)
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1841)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1409)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2114)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2038)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1899)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1412)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427)
at android.os.Parcel.readSerializable(Parcel.java:3142)
at android.os.Parcel.readValue(Parcel.java:2920)
at android.os.Parcel.readArrayMapInternal(Parcel.java:3252)
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)
at android.os.BaseBundle.unparcel(BaseBundle.java:236)
at android.os.BaseBundle.getString(BaseBundle.java:1169)
at android.content.Intent.getStringExtra(Intent.java:7925)
at com.microsoft.aad.adal.AuthenticationActivity.z(:477)
at com.microsoft.aad.adal.AuthenticationActivity.w(:384)
at com.microsoft.aad.adal.AuthenticationActivity.onCreate(:164)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loop(Looper.java:224) 
at android.app.ActivityThread.main(ActivityThread.java:7562) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 
Caused by: java.lang.NoSuchMethodException: com.microsoft.aad.adal.H.values []
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getDeclaredMethod(Class.java:2050)
at java.lang.Enum.enumValues(Enum.java:267)
at java.lang.Enum.access$000(Enum.java:61) 
at java.lang.Enum$1.create(Enum.java:277) 
at java.lang.Enum$1.create(Enum.java:275) 
at libcore.util.BasicLruCache.get(BasicLruCache.java:63) 
at java.lang.Enum.getSharedConstants(Enum.java:289) 
at java.lang.Enum.valueOf(Enum.java:243) 
at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1841) 
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1409) 
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2114) 
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2038) 
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1899) 
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1412) 
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:427) 
at android.os.Parcel.readSerializable(Parcel.java:3142) 
at android.os.Parcel.readValue(Parcel.java:2920) 
at android.os.Parcel.readArrayMapInternal(Parcel.java:3252) 
at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292) 
at android.os.BaseBundle.unparcel(BaseBundle.java:236) 
at android.os.BaseBundle.getString(BaseBundle.java:1169) 
at android.content.Intent.getStringExtra(Intent.java:7925) 
at com.microsoft.aad.adal.AuthenticationActivity.z(:477) 
at com.microsoft.aad.adal.AuthenticationActivity.w(:384) 
at com.microsoft.aad.adal.AuthenticationActivity.onCreate(:164) 
at android.app.Activity.performCreate(Activity.java:7893) 
at android.app.Activity.performCreate(Activity.java:7880) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3283) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3457) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loop(Looper.java:224) 
at android.app.ActivityThread.main(ActivityThread.java:7562) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) 

Steps to reproduce the problem:

  1. Apply proguard as per github documentation : https://github.com/AzureAD/azure-activedirectory-library-for-android/wiki/ProGuard
  2. Run release build and install the apk.
  3. App will crash on launching the AuthenticationActivity.

Environment : Android Target SDK version 30
Devices: Tested on multiple devices
Gradle : distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
implementation 'com.microsoft.aad:adal:1.15.1'

@paulkagiri
Copy link
Contributor

Hello @YormanS, are you still experiencing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants