Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Null Pointer Exception on android.hardware.fingerprint.FingerprintManager.isHardwareDetected() #195

Open
abumoallim opened this issue Nov 14, 2018 · 2 comments

Comments

@abumoallim
Copy link

I am getting null pointer exception on Xiomi Mobile particularly.

I am using Lollipin for 6 months.
This has recently occurred in Xiomi phone. Though it works on other phones.

I would like to know if any possible solution for this.

I am posting detail of error and Device details :

Fatal Exception: java.lang.RuntimeException
Unable to resume activity {.CustomPinActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.hardware.fingerprint.FingerprintManager.isHardwareDetected()' on a null object reference

Android : 8.1.0 and Mobile : Xiomi Redmi 6A .

@yar1k0v
Copy link

yar1k0v commented Feb 14, 2019

Up, I got the same issue with the library ver. 2.0

@yar1k0v
Copy link

yar1k0v commented Feb 14, 2019

The cause of this exception is that on many devices the FingerprintManager is not accessible (the reference is null) and to access it you need a vendors SDK installed with its own libraries set.
The quick solution here is to add a null check inside FingerprintUiHelper.isFingerprintAuthAvailable() (line number 222) method on the FingerprintManager class right before calling any method on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants