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

java.lang.NullPointerException for initLayoutForFingerprint #184

Open
Vojtas87 opened this issue Aug 25, 2018 · 4 comments
Open

java.lang.NullPointerException for initLayoutForFingerprint #184

Vojtas87 opened this issue Aug 25, 2018 · 4 comments

Comments

@Vojtas87
Copy link

Hello,

I received this crash report in my app (devices with Android 8.1):

`java.lang.NullPointerException
com.github.omadahealth.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint

java.lang.RuntimeException:
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3581)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3621)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2862)
at android.app.ActivityThread.-wrap11 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1589)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:164)
at android.app.ActivityThread.main (ActivityThread.java:6494)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:440)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807)

Caused by: java.lang.NullPointerException:
at com.github.omadahealth.lollipin.lib.managers.AppLockActivity.initLayoutForFingerprint (AppLockActivity.java:147)
at com.github.omadahealth.lollipin.lib.managers.AppLockActivity.onResume (AppLockActivity.java:84)
at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1355)
at android.app.Activity.performResume (Activity.java:7117)
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3556)`

Could you take a look at this, please?

Thank you in advance.

@anton-piliugin
Copy link

anton-piliugin commented Sep 19, 2018

Fixed that by removing a build library from dependencies and added "lib" dir from github sources.
0. Remove "implementation('com.github.omadahealth:lollipin:2..." from build.gradle

  1. Add "implementation project(':lib')" to build.gradle
  2. Add "include ':lib'" to your settings.gradle
  3. Copy(change if needed) variables from gradle.properties in lollipin github sources to your gradle.properties file
  4. Change to: if (mFingerprintManager != null && mFingerprintManager.isHardwareDetected() && mFingerprintUiHelper.isFingerprintAuthAvailable() on line 147 in AppLockActivity.java

P.S.: FOR LOLLIPIN DEVELOPERS - Added a pull request. Please add also a fresh version which includes this fix to all of your repositories

@Vojtas87
Copy link
Author

@anton-piliugin I can confirm it works! Affected users are happy now! Great tutorial. Thank you very much!

@anton-piliugin
Copy link

@anton-piliugin I can confirm it works! Affected users are happy now! Great tutorial. Thank you very much!

Awesome! Will see when developers of Lollipin will release a new version with fix

@alexkeramidas
Copy link
Contributor

Yeah same here, using the lollipin library as a project lib dependency and not as suggested in the docs for ages now.

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

3 participants