Closed iagormoraes closed 4 years ago
I am getting the same on "react-native-fingerprint-scanner": "5.0.0", with a Samsung S9:
Fatal Exception: java.lang.IllegalArgumentException: FragmentActivity must not be null
at androidx.biometric.BiometricPrompt.<init>(BiometricPrompt.java:584)
at com.hieuvp.fingerprint.ReactNativeFingerprintScannerModule.getBiometricPrompt(ReactNativeFingerprintScannerModule.java:109)
at com.hieuvp.fingerprint.ReactNativeFingerprintScannerModule$1.run(ReactNativeFingerprintScannerModule.java:123)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7857)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
The issue is happening on the instance of BiometricPrompt, line 109 where FragmentActivity must not be null
maybe a fix could be
FragmentActivity fragmentActivity = (FragmentActivity) mReactContext.getCurrentActivity();
EDIT: I've forked this repo to fix this problem, can check here
Description
Hello, I'm having issues with the fingerprint on some devices in android 9 and 10, the stack trace points to the instance of BiometricPrompt.
Package Version
react-native: 0.62.2 react-native-fingerprint-scanner: ^4.0.0
Affected devices
Redmi Note 7
Huawei P20 lite
ZTE Z717VL (lavender)
Huawei Honor 9 Lite (HWLLD-H)
Samsung Galaxy S8+ (dream2lte)
Samsung Galaxy A30s (a30s)
Redmi Redmi K20 (davinci)
Stack trace