[TIMOB-24413] Android: Ti.TouchID crashes app on unsupported devices
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-03-13T16:41:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | android, module, ti.touchid |
Reporter | Andrea Jonus |
Assignee | Gary Mathews |
Created | 2017-02-17T08:46:56.000+0000 |
Updated | 2017-08-31T07:54:10.000+0000 |
Description
Ti.TouchID causes a crash on Android devices that don't support fingerprint authentication, or where any fingerprint hasn't been added yet.
In such devices, the constructor for FingerPrintHelper throws an exception, and every subsequent reference to the object triggers an error of this kind:
JNI ERROR (app bug): attempt to use stale global reference
*Steps to reproduce:*
- Create a Titanium app that requires ti.touchid
- Install on a Android device with no fingerprint added by the user
- Call any method of ti.touchid
Can you try the [Ti.TouchID 2.1.0](https://github.com/appcelerator-modules/ti.touchid/releases/tag/android-2.1.0) version on Android? One of the fixes was exactly for that. In general: Follow Github repos for those updates, since patches are available there before they are distributed with the SDK (2.1.0 will be prepackaged in SDK 6.1.0).
I'm currently using the 2.1.0 version. Sorry, i forgot to add the module version in the description. I saw https://github.com/appcelerator-modules/ti.touchid/pull/24 and https://github.com/appcelerator-modules/ti.touchid/pull/25 , but i don't think they cover this case.
But if you check with
TouchID. isSupported()
and it returns false, you shouldn't call any of the other methods. That's why we have that method exposed. Or do I understand something wrong?The problem is that the app crashes when calling ANY method of TouchID when the device is not supported, INCLUDING
TouchID.isSupported()
.All others are supposed to fail, otherwise we would need to guard all method as well, which would result in a duplicated check. I'm still wondering why
isSupported()
crashes though. Let us check that, moving to TIMOB.Community PR: https://github.com/appcelerator-modules/ti.touchid/pull/27
[~hansknoechel] Hi Hans I was wondering whether this is an open ticket or the ticket is needing to be reviewed ?
[~awaldman] It's open and assigned to [~gmathews], so he'll probably put it into review when he reviews it :-)
Checked the fix by building the
ti.touchid
module from source & the app does not crash on unsupported devices. Closing. Appc Studio : 4.8.1.201612050850 SDK Version : 6.1.0.v20170315131319 Mac OS Version : 10.12.3 Xcode Version : Xcode 8.2.1 Build version 8C1002 Appc CLI AND Appc NPM : {"NPM":"4.2.8","CLI":"6.1.0"} Ti CLI : 5.0.11 Alloy : 1.9.5 Node : v4.6.0 Device: running 7.1.1Pixel, Nexus 6 android 6.0.1[~aislam] Updated the
2.2.0
pre-release .zip, please re-download and try again?Hi, Unable to reproduce that error with updated the 2.2.0 pre-release and latest SDK 6.1.1.GA on Android 6 (HTC one).
Hi, This issue is not resolved with 6.1.0 GA. We are still facing the issue when trying to access any of the methods of ti.touchId module. Application is crashing when trying to access any method of touchid module on devices which does not support touch id. SDK : 6.1.2 GA Crashing on Devices : Nexus 7 (6.0.0) , Moto G3 (6.0.0)
[~Snigdha.Nooli] Please sure you use the latest module-version ([here](https://github.com/appcelerator-modules/ti.touchid/releases/tag/android-2.2.0), includes some more enhancements since then). The fix-version 6.1.0 just means that the updated module is included in that SDK, but you may still want to manually reference it in case you are running into issues. Example to ensure Ti.TouchID 2.2.0:
[~Snigdha.Nooli] You can do this for unsupported devices:
Thanks. The issue is resolved with touchid module version 2.2.0.