titanium-identity icon indicating copy to clipboard operation
titanium-identity copied to clipboard

Error: CryptoObject cannot be null

Open jordanbisato opened this issue 1 year ago • 5 comments

Hi,

i get many crash logs like this in Firebase Crashlytics, but can't reproduce while debugging.

The most affected manufacturer is Samsung Galaxy.

Someone else get this error?

Non-fatal Exception: java.lang.Throwable at /alloy/controllers/login.js.Uncaught Error: CryptoObject cannot be null.(TiIdentity.authenticate({:553) at androidx.biometric.BiometricPrompt.authenticate(BiometricPrompt.java:939) at ti.identity.FingerPrintHelper.startListening(FingerPrintHelper.java:153) at ti.identity.TitaniumIdentityModule.authenticate(TitaniumIdentityModule.java:165) at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63) at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:985) at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1219) at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:260) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:246) at at Label.autenticar (login.js:553) at at Label.value (kroll.js:1604) at at Label.value (kroll.js:1656)

My code:

  var TiIdentity = require('ti.identity');
  var keychainItem = TiIdentity.createKeychainItem({
	identifier: '******',
	cancelTitle: "Cancelar",
	fallbackTitle: "Utilizar Senha",
});

  TiIdentity.authenticate({
	reason: 'Use sua impressão digital para logar',
	fallbackTitle: 'Usar senha',
	cancelTitle: 'Cancelar', 
	callback: function (e) {
		Ti.API.info('authenticate e: ' + JSON.stringify(e));
		if (e.success) {
			keychainItem.read();
		} else {
			TiIdentity.invalidate();
		}
	}
});

jordanbisato avatar Jul 14 '22 22:07 jordanbisato

The same. Did you find a solution?

yuranevmer avatar Oct 03 '22 16:10 yuranevmer

@yuranevmer Probably happened in this line, but i don't know how to solve it.

https://github.com/tidev/titanium-identity/blob/50b09e3f907bc8106c991dfdf3d0ce53dd08e4eb/android/src/ti/identity/FingerPrintHelper.java#L340

jordanbisato avatar Oct 06 '22 22:10 jordanbisato

can you check https://github.com/tidev/titanium-identity/pull/309

Shouldn't crash at that place now.

m1ga avatar Oct 07 '22 15:10 m1ga

thanks! I could not reproduce in single device. but I will check firebase crashlytics results with fixed version

yuranevmer avatar Oct 07 '22 16:10 yuranevmer

#309 fix this error

jordanbisato avatar Feb 28 '23 12:02 jordanbisato