Skip to content
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

Attempting to scan NFC or barcode causes Android app to crash #22

Open
spencerAEE opened this issue Feb 10, 2023 · 8 comments
Open

Attempting to scan NFC or barcode causes Android app to crash #22

spencerAEE opened this issue Feb 10, 2023 · 8 comments

Comments

@spencerAEE
Copy link
Contributor

Current Behaviour

React Capacitor app consistently crashes after attempting to scan NFC or barcodes using the examples provided. With NFC it just immediately crashes even if no tags are near and for barcode it crashes as soon as the camera detects a barcode.

Expected Behaviour

App should not crash and NFC tags/barcodes should be scanned.

Steps to Reproduce the Problem

  1. Create project with boilerplate code for NFC and barcode
  2. Build APK and install on Android device
  3. Attempt to scan items

Context

Samsung S9, Android 10, Android Studio 2022.1.1 (Electric Eel), Gradle 7.4.1

  • Version: 0.5.0-beta.9
  • Platform: Android
  • Capacitor version: 4.6.3
@spencerAEE
Copy link
Contributor Author

Still having trouble with this. Not sure how relevant this is but if I run the code on browser, the functions return undefined. I assume that's just because there's no NFC hardware to access from the browser but I still felt it was worth pointing out in case it could help lead to the source of the issue.

@spencerAEE
Copy link
Contributor Author

Also worth noting is this error message that comes up when I try to trigger a scan in the emulator. It looks as though there could be a problem with the MRZ library, and even though I'm not even trying to use MRZ that's still having an impact.

emulator_error

@rs2-davebanguilan
Copy link

Hi @spencerAEE what @idpass/smartscanner-capacitor version are you using? Also, do you have the necessary .aar files? If yes, can you give me the link where you downloaded it?

@spencerAEE
Copy link
Contributor Author

I am using the most current release on Node, which is 0.5.0-beta.9. As for the required .aar files, they are actually in this repository under the android directory, although I plan on attempting to rebuild them and fix the error noted above.

@rs2-davebanguilan
Copy link

rs2-davebanguilan commented Feb 15, 2023

I think I have experienced that before. If my memory serves me right, the cause of that error is using different .aar file. Are you using these files?

@spencerAEE
Copy link
Contributor Author

I'll be honest, I ended up just moving the project to React Native and using their NFC management plugin instead as it provides more features and stability out of the box. That being said, I still want to keep experimenting with this in my free time.

@nicholemnl
Copy link
Collaborator

nicholemnl commented Feb 17, 2023

Hello @spencerAEE Thank you for creating this Ticket.

We will need to investigate this further.

@rjmangubat23
Copy link
Contributor

@spencerAEE @nicholemnl this crash concerning NoSuchMethodError could mean that MLKit library is not present when you built the APK wtih the capacitor plugin.

This probably could be due to a number of things but from my experience I think it may be due to:

Hope this helps. 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants