okta / okta-react-native

OIDC enablement for React Native applications
https://github.com/okta/okta-react-native
Other
58 stars 39 forks source link

error when call createConfig on android #402

Open dioi2000 opened 11 months ago

dioi2000 commented 11 months ago

Describe the bug?

error when call createConfig on android (newArchEnabled=true, false both)

What is expected to happen?

no error with createConfig

What is the actual behavior?

createConfig fail with error

Exception in native call java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference at com.facebook.react.bridge.ReadableNativeArray.getBoolean(ReadableNativeArray.java:87) at com.facebook.react.bridge.JavaMethodWrapper$1.extractArgument(JavaMethodWrapper.java:37) at com.facebook.react.bridge.JavaMethodWrapper$1.extractArgument(JavaMethodWrapper.java:33) at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:356) at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188) at com.facebook.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) at java.lang.Thread.run(Thread.java:1012)

Reproduction Steps?

await createConfig({ clientId: '--------------', redirectUri: 'com.-----.appname:/okta', endSessionRedirectUri: 'com.-----.appname:/logout', discoveryUri: 'https://------.---------.com/', scopes: ["openid", "profile", "offline_access"], });

Additional Information?

"dependencies": { "@eliav2/react-native-collapsible-view": "^1.5.1", "@okta/okta-react-native": "^2.10.0", "@react-native-async-storage/async-storage": "^1.21.0", "@react-native-clipboard/clipboard": "1.11.2", "@react-native-firebase/app": "^18.7.1", "@react-native-firebase/messaging": "^18.7.1", "@react-navigation/bottom-tabs": "^6.5.11", "@react-navigation/drawer": "^6.6.6", "@react-navigation/native": "^6.1.9", "@react-navigation/stack": "^6.3.20", "@sourcetoad/react-native-sketch-canvas": "^1.0.4", "dayjs": "^1.11.10", "react": "18.2.0", "react-native": "^0.72.7", "react-native-blob-util": "^0.19.6", "react-native-calendars": "^1.1302.0", "react-native-draggable-flatlist": "^4.0.1", "react-native-drawer-layout": "^3.2.1", "react-native-dropdown-picker": "^5.4.6", "react-native-email-link": "^1.14.7", "react-native-fast-image": "git+https://github.com/numandev1/react-native-fast-image#feat/fabric-wolewicki", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.14.0", "react-native-linear-gradient": "^2.8.3", "react-native-localization": "^2.3.2", "react-native-maps": "^1.8.4", "react-native-pdf": "^6.7.4", "react-native-reanimated": "^3.6.1", "react-native-render-html": "^6.3.4", "react-native-reorderable-list": "^0.4.0", "react-native-safe-area-context": "4.7.4", "react-native-screens": "3.27.0", "react-native-simple-default-props": "^1.0.0", "react-native-simple-toast": "^3.2.0", "react-native-svg": "14.0.0", "react-native-svg-charts": "^5.4.0", "react-native-video": "^5.2.1", "react-native-webview": "^13.6.3", "recoil": "^0.7.7" },

SDK Version

2.10.0

Build Information

Redmi Pad SE 23073RPBFL Android 13

android gradle 8.0.1 Apple M1 Pro / 14.1.1(23B81)

rajdeepnanua-okta commented 11 months ago

Hi @dioi2000, thanks for filing this bug. Unfortunately, I don't see anything obvious that could be causing this issue. I also tried reproducing a similar setup, but was unable to run into this crash. Is this issue reproducible for you locally? If so, could you run 'adb logcat' while reproducing this issue, and check the output for any exceptions being thrown in com.okta.oidc. or com.oktareactnative. packages? This issue happens if the Android bridge code doesn't resolve the promise for createConfig, which should happen if there's a runtime exception happening in the Android bridge.

spearmootz commented 9 months ago

@dioi2000 i had this same issue. make sure to declare the property requireHardwareBackedKeyStore on the config.