nisrulz / lantern

🏮[Android Library] Handling device flash as torch for Android.
https://nisrulz.com/lantern/
Apache License 2.0
83 stars 23 forks source link

Lantern.java line 108 Crash #9

Open ytheekshana opened 5 years ago

ytheekshana commented 5 years ago

This is another crash.

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=6937, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.ytheekshana.deviceinfo/com.nabinbhandari.android.permissions.PermissionsActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void github.nisrulz.lantern.FlashController.off()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4519) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4563) at android.app.ActivityThread.-wrap21(Unknown Source) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:7002) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void github.nisrulz.lantern.FlashController.off()' on a null object reference at github.nisrulz.lantern.Lantern.enableTorchMode(Lantern.java:108) at com.ytheekshana.deviceinfo.FlashlightTestActivity$1.onGranted(FlashlightTestActivity.java:84) at com.nabinbhandari.android.permissions.PermissionsActivity.grant(PermissionsActivity.java:228) at com.nabinbhandari.android.permissions.PermissionsActivity.onRequestPermissionsResult(PermissionsActivity.java:122) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7811) at android.app.Activity.dispatchActivityResult(Activity.java:7634) at android.app.ActivityThread.deliverResults(ActivityThread.java:4515) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4563) at android.app.ActivityThread.-wrap21(Unknown Source) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1779) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:7002) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

1

nisrulz commented 5 years ago

Was addressed in this commit, I just pushed a few minutes back: https://github.com/nisrulz/lantern/commit/4951ecee1e8eaf2f830e342396b5f20defb3c62a

ytheekshana commented 5 years ago

Was addressed in this commit, I just pushed a few minutes back: 4951ece

Thanks. Waiting for the next public release with AndroidX.

ytheekshana commented 5 years ago

Got another crash on another line

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=6937, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.ytheekshana.deviceinfo/com.nabinbhandari.android.permissions.PermissionsActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void github.nisrulz.lantern.c.a()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4616) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4658) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1959) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7075) 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:965)

Caused by java.lang.NullPointerException: Attempt to invoke interface method 'void github.nisrulz.lantern.c.a()' on a null object reference at github.nisrulz.lantern.Lantern.access$000(Lantern.java:62) at com.ytheekshana.deviceinfo.tests.FlashlightTestActivity$1.onGranted(FlashlightTestActivity.java:12) at com.nabinbhandari.android.permissions.PermissionsActivity.access$200(PermissionsActivity.java:7) at com.nabinbhandari.android.permissions.PermissionsActivity.onRequestPermissionsResult(PermissionsActivity.java:44) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7954) at android.app.Activity.dispatchActivityResult(Activity.java:7776) at android.app.ActivityThread.deliverResults(ActivityThread.java:4609) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4658) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1959) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7075) 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:965)