-
-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException in crash logs #370
Comments
Same here. Used to failed with Samsung devices and some Xiaomi another common case is Android 11. I have the same Issue on Production with some users where the App crash when use Fingerprint: Environment"cordova-plugin-fingerprint-aio": "^3.0.1", Android 11 (SDK 30)
LogsCaused by java.lang.NullPointerException: Attempt to invoke virtual method 'void org.apache.cordova.CallbackContext.sendPluginResult(org.apache.cordova.PluginResult)' on a null object reference at de.niklasmerz.cordova.biometric.Fingerprint.lambda$sendError$1$Fingerprint(Fingerprint.java:117) at de.niklasmerz.cordova.biometric.-$$Lambda$Fingerprint$HQesV6eLUymiZZSDRXppmLSXqEY.run(:4) at android.app.Activity.runOnUiThread(Activity.java:7153) at de.niklasmerz.cordova.biometric.Fingerprint.sendError(Fingerprint.java:116) at de.niklasmerz.cordova.biometric.Fingerprint.onActivityResult(Fingerprint.java:89) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:159) at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:368) at android.app.Activity.dispatchActivityResult(Activity.java:8476) at android.app.ActivityThread.deliverResults(ActivityThread.java:5132) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4532) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4577) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2142) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:7864) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:620) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1011) |
I am also facing the same issue, do we have update on this.? @NiklasMerz |
The following changes would probably do good in Fingerprint.java: public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
// Just making sure!
if (callbackContext == null) {
Log.v(TAG, "Fingerprint callbackContext is null");
return FALSE;
}
Log.v(TAG, "Fingerprint action: " + action);
switch(action) {
case "authenticate":
executeAuthenticate(args);
break;
case "registerBiometricSecret":
executeRegisterBiometricSecret(args);
return true;
case "loadBiometricSecret":
executeLoadBiometricSecret(args);
break;
case "isAvailable":
executeIsAvailable();
break;
default:
return false;
}
return true;
}
private void sendSuccess(Intent intent) {
Bundle extras;
if (intent != null && (extras = intent.getExtras()) != null) {
sendSuccess(extras.getString(PromptInfo.SECRET_EXTRA));
} else {
sendSuccess("biometric_success");
}
}
private void sendError(Intent intent) {
Bundle extras;
if (intent != null && (extras = intent.getExtras()) != null) {
sendError(extras.getInt("code"), extras.getString("message"));
} else {
sendError(PluginError.BIOMETRIC_DISMISSED);
}
} |
I wound't know why the |
any update on this ? lot of users are facing this issue (app crashes), please let us know if there is any fix/workaround? |
same issue on samsung devices |
Bug report
Description
I haven't had any issues locally but I noticed a nullpointerexecption in my app's crash logs:
Environment
"cordova-plugin-fingerprint-aio": "4.0.2",
"cordova-android": "9.1.0",
Android 11 (SDK 30)
Samsung Galaxy A32 5G
Samsung Galaxy A12
Logs
The text was updated successfully, but these errors were encountered: