naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.
https://www.npmjs.com/package/react-native-touch-id
1.47k stars 477 forks source link

TypeError: Cannot read property 'isSupported' of undefined #271

Open sarray23 opened 4 years ago

sarray23 commented 4 years ago

This error shows up only with android emulators (iOS works fine).

I already import TouchID from 'react-native-touch-id' in my RN project.

Any idea about this issue ?

jagowm commented 4 years ago

Hi, the same here, any update

pke commented 4 years ago

This also happens on devices without any such sensor. The exported object is undefined in that case. It should however be on object, that returns false on isSupported. The problems are here: https://github.com/naoufal/react-native-touch-id/blob/master/TouchID.ios.js#L17 and here https://github.com/naoufal/react-native-touch-id/blob/master/TouchID.android.js#L7

sarray23 commented 4 years ago

No, since there's no updates in android folder of the project

peng92055 commented 4 years ago

You need edit your MainApplication.java in android/app/src/main/**/ @Override protected List getPackages() { return Arrays.asList( new AppMainReactPackage(),

sarray23 commented 4 years ago

This answer won't solve the problem.