Closed kirtipopli83 closed 3 years ago
Hi, thanks for the issue. Could you please provide us steps to recreate your issue?
Write this code in main method which will be used to initialize authenticationClient
class BaseActivity{
var authenticationClient: AuthenticationClient? = null
fun main(){ try { authenticationClient = AuthenticationClients.builder() .setOrgUrl(BuildConfig.OKTA_BASE_URL) .build() } catch (e: ExceptionInInitializerError) { Timber.d("AuthenticationClient %s", e.message) } catch (e: Exception) { Timber.d("AuthenticationClient %s", e.message) } } }
Let's take a step back and make sure we can get a working configuration! It sounds like what you want to do is use what we call in our samples "custom sign on".
We've got a simple sample you can use to make it easy to make sure your configuration is working. After cloning this repo, I was able to get this project working with just the configuration changes mentioned in the readme. https://github.com/okta/samples-android/tree/master/custom-sign-in#configuration
The build.gradle in this project should have all the required dependencies to ensure you don't have missing classes (given the issue description) https://github.com/okta/samples-android/blob/master/custom-sign-in/app/build.gradle
I have implemented in the same way, followed the custom-sign-on example only when I started working.
But still I get this error many times
java.lang.NoClassDefFoundError: com.okta.commons.configcheck.ConfigurationValidator at com.okta.commons.configcheck.ConfigurationValidator.assertOrgUrl(ConfigurationValidator.java:74) at com.okta.authn.sdk.impl.client.DefaultAuthenticationClientBuilder.setOrgUrl(DefaultAuthenticationClientBuilder.java:217)
Caused by: java.lang.ExceptionInInitializerError at com.okta.commons.configcheck.ConfigurationValidator.assertOrgUrl(ConfigurationValidator.java:74) at com.okta.authn.sdk.impl.client.DefaultAuthenticationClientBuilder.setOrgUrl(DefaultAuthenticationClientBuilder.java:217)
Caused by: java.util.MissingResourceException: Can't find bundle for base name com/okta/commons/configcheck/configuration-validator, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1558)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1381)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:771)
at com.okta.commons.configcheck.ConfigurationValidator.
Can you please ensure you have these dependencies in your build.gradle file?
https://github.com/okta/samples-android/blob/master/custom-sign-in/app/build.gradle#L59-L62
Yes, I have added all the dependencies as in the given above link
@NikitaAvraimov-okta do you have any ideas here?
I am still not able to figure out, what happens at the time of initialization,
It always crashes the app on .setOrgUrl(url)
try { authenticationClient = AuthenticationClients.builder() .setOrgUrl(BuildConfig.OKTA_BASE_URL) .build() } catch (e: ExceptionInInitializerError) { Timber.d("AuthenticationClient %s", e.message) }
Let`s do further conversation at https://github.com/okta/okta-oidc-android/issues/234 to not confuse anyone who might be facing the same problem.
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