okta / okta-oidc-android

OIDC SDK for Android
https://github.com/okta/okta-oidc-android
Other
60 stars 45 forks source link

NoClassDefFoundError: com.okta.commons.configcheck.ConfigurationValidator #234

Closed kirtipopli83 closed 2 years ago

kirtipopli83 commented 3 years ago

When I am opening the app authentication client is not able to find the class and throwing error as java.lang.NoClassDefFoundError: com.okta.commons.configcheck.ConfigurationValidator

The SDK is not able to get initialized because this particular class is not getting read by SDK methods and throws exception even if the class is there.

This is very important issue. Without it app has no meaning.

kirtipopli83 commented 3 years ago

@JayNewstrom , @frett @dfilatov-okta @haguilar-okta Can you please look into this issue. I already raised an issue earlier but did not get any solution.

https://github.com/okta/samples-android/issues/62

NikitaAvraimov-okta commented 3 years ago

@kirtipopli83 I`m taking a look. Is it reproducable on any device/emulator? Did you use minifyEnabled?

kirtipopli83 commented 3 years ago

Yes, It is reproducable on every device but occurs sometimes.

And I have not used minifyEnabled.

buildTypes { debug { debuggable true minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug } release { debuggable false minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } }

FeiChen-okta commented 3 years ago

Hi @kirtipopli83 can you run the following gradle command

./gradlew {yourApp}:androidDependencies

Running this for the sample app ./gradlew app:androidDependencies will show a list dependencies for each configuration. Look for

releaseCompileClasspath - Dependencies for compilation
releaseRuntimeClasspath - Dependencies for runtime/packaging

to see if the jar is listed

+--- com.okta.commons:okta-config-check:1.1.1@jar

The version may differ based on the okta-authn-sdk that you are using.

kirtipopli83 commented 3 years ago

Hi @FeiChen-okta

I executed the command and found this version present

com.okta.commons:okta-config-check:1.2.4@jar

kirtipopli83 commented 3 years ago

@FeiChen-okta @NikitaAvraimov-okta @frett Any update?

FeiChen-okta commented 3 years ago

Hi @kirtipopli83 It looks like you are using the latest okta-authn-sdk. Can you share the implementation? Do you still have the problem if using the version from the sample?

    implementation 'com.okta.authn.sdk:okta-authn-sdk-api:1.0.0'
    implementation('com.okta.authn.sdk:okta-authn-sdk-impl:1.0.0')
NikitaAvraimov-okta commented 3 years ago

@kirtipopli83 do you have such rule at your proguard rules file? -keep class com.okta.** { *; }

kirtipopli83 commented 3 years ago

No. It's not added in proguard rules.

JayNewstrom commented 3 years ago

@kirtipopli83 could you please try adding that keep rule to your proguard config and report back if that fixes your issue?

JayNewstrom commented 3 years ago

Hi @kirtipopli83, have you had a chance to report your findings?