Okta oidc android lib throwing error for Android api levels < 24

Error message: Fatal Exception: java.lang.NoSuchMethodError
No static method stream([Ljava/lang/Object;)Ljava/util/stream/Stream; in class Ljava/util/Arrays; or its super classes (declaration of ‘java.util.Arrays’ appears in /system/framework/core-libart.jar)

File: https://github.com/okta/okta-sdk-java/blob/master/impl/src/main/java/com/okta/sdk/impl/config/DefaultEnvVarNameConverter.java

Okta oidc android is internally using okta-sdk-java to implement sessionToken flow. Above file is using Arrays.stream method on line 46. This line is failing on marshmellow and lollipop (java 7 sdk). Is there any way to fix this.

StackTrace:
com.okta.sdk.impl.config.DefaultEnvVarNameConverter.buildReverseLookupToMap (DefaultEnvVarNameConverter.java:46)
com.okta.sdk.impl.config.DefaultEnvVarNameConverter. (DefaultEnvVarNameConverter.java:34)
com.okta.sdk.impl.config.EnvironmentVariablesPropertiesSource$OktaFilteredEnvironmentPropertiesSource. (EnvironmentVariablesPropertiesSource.java:44)
com.okta.sdk.impl.config.EnvironmentVariablesPropertiesSource.oktaFilteredPropertiesSource (EnvironmentVariablesPropertiesSource.java:39)
com.okta.authn.sdk.impl.client.DefaultAuthenticationClientBuilder. (DefaultAuthenticationClientBuilder.java:94)
com.okta.authn.sdk.impl.client.DefaultAuthenticationClientBuilder. (DefaultAuthenticationClientBuilder.java:85)
java.lang.reflect.Constructor.newInstance (Constructor.java)
java.lang.Class.newInstance (Class.java:1606)
com.okta.sdk.lang.Classes.newInstance (Classes.java:166)
com.okta.sdk.lang.Classes.newInstance (Classes.java:152)
com.okta.authn.sdk.client.AuthenticationClients.builder (AuthenticationClients.java:43)
com.designcapital.lemoney.authentication.LeAuthenticationClient.getAuthClient (LeAuthenticationClient.kt:25)
com.designcapital.lemoney.authentication.LeAuthenticationClient_GetAuthClientFactory.getAuthClient (LeAuthenticationClient_GetAuthClientFactory.java:27)
com.designcapital.lemoney.authentication.LeAuthenticationClient_GetAuthClientFactory.get (LeAuthenticationClient_GetAuthClientFactory.java:18)
com.designcapital.lemoney.authentication.LeAuthenticationClient_GetAuthClientFactory.get (LeAuthenticationClient_GetAuthClientFactory.java:8)
dagger.internal.DoubleCheck.get (DoubleCheck.java:47)
com.designcapital.lemoney.components.DaggerApplicationComponent.injectLoginDataSource (DaggerApplicationComponent.java:195)
com.designcapital.lemoney.components.DaggerApplicationComponent.inject (DaggerApplicationComponent.java:156)
com.designcapital.lemoney.data.login.LoginDataSource. (LoginDataSource.kt:52)
com.designcapital.lemoney.ui.login.LoginViewModelFactory.create (LoginViewModelFactory.kt:19)

The okta-sdk-java uses Java8 features that are not supported on API < 24. For these devices you can try using the bazel libraries. https://github.com/okta/okta-oidc-android/tree/authn_android

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.