hieuvp / react-native-fingerprint-scanner

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)
https://www.npmjs.com/package/react-native-fingerprint-scanner
871 stars 297 forks source link

Android app getting crashed after updating package to 4.0.0 #132

Closed sumerpatel closed 4 years ago

sumerpatel commented 4 years ago

After updating react-native-fingerprint-scanner package to latest version android app started getting crashed. Attached a screenshot of the error.

Here is my code : -

error: ReactNativeFingerprintScanner.authenticate got 2 arguments, expected 3

FingerprintScanner.authenticate({ onAttempt: this.handleAuthenticationAttempted, }) .then(() => { this.handleSuccess(labels); }) .catch((error: { message: any }) => { this.setState({ errorMessage: error.message }); });

Screenshot 2020-04-24 at 7 53 03 AM
mikehardy commented 4 years ago

if you update and start having problems, always try npx react-native-clean-project first to blow out any of the caches that might have stale version code in them

sumerpatel commented 4 years ago

this didn't work

mikehardy commented 4 years ago

How did it work when you cloned this repo and used the example? If it works, your local project has a problem, but the module is fine, and it's not a bug, it's a project problem you'll have to figure out

sahil290791 commented 4 years ago

@sumerpatel what is RN version, Platform ios? android? and OS version?

sumerpatel commented 4 years ago

@sahil290791 RN : 0.61.5, Platform - Android, OS version - 10

NaNtrack commented 4 years ago

The same error with: Android 28, 29, R react-native: 0.59.10

mikehardy commented 4 years ago

How did it work when you cloned this repo and used the example?

NaNtrack commented 4 years ago

i had the old bundle and map files in:

android/app/src/main/assets/index.android.bundle
android/app/src/main/assets/index.android.map

after recreating those files start working again

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --sourcemap-output android/app/src/main/assets/index.android.map --assets-dest android/app/src/main/res/

mikehardy commented 4 years ago

@NaNtrack do not do that! Never copy built assets into the src tree.

This was the source of many problems, a PR directly into react-native, and then a revert of that PR. There is a correct way to do the bundle, and this is it: https://github.com/facebook/react-native/issues/22234#issuecomment-504721069

NaNtrack commented 4 years ago

we dont have those files versioned on git, so no worries...

mikehardy commented 4 years ago

we dont have those files versioned on git, so no worries...

If you read that thread you'll realize it causes problems in local builds frequently, like you experienced. I also had those files .gitignore'd but it still blows up your local environment and/or masks changes you make (like software version upgrades).

If that's how you want to develop, okay, but given there's a posted solution that works and the way you're doing it (and the way I was doing it) was conclusively shown to be wrong, seems odd to want to keep doing it.

NaNtrack commented 4 years ago

we dont have those files versioned on git, so no worries...

If you read that thread you'll realize it causes problems in local builds frequently, like you experienced. I also had those files .gitignore'd but it still blows up your local environment and/or masks changes you make (like software version upgrades).

If that's how you want to develop, okay, but given there's a posted solution that works and the way you're doing it (and the way I was doing it) was conclusively shown to be wrong, seems odd to want to keep doing it.

thanks for the advice, we will find a better solution to avoid this problem in the future

sumerpatel commented 4 years ago

How did it work when you cloned this repo and used the example?

Created a new RN project with version 0.61.5 and it still didn't work.

mikehardy commented 4 years ago

new project != clone repo + use example, I'm very curious if the example in this repo works if it does, then what is the difference between the example and a fresh project?