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

deps: Replace react-native-camera-kit with react-native-vision-camera #1671

Merged
merged 9 commits into from
May 22, 2024

Conversation

myxmaster
Copy link
Contributor

@myxmaster myxmaster commented Sep 19, 2023

Description

Relates to issues: #687, #1545

Replaced react-native-camera-kit with react-native-vision-camera.

Improvements:

  • better performance (faster & less problems with scanning dense QRs)
  • seemless integration of camera view in the app
  • pinch to zoom & tap to focus
  • harmonized icon sizes and margins
  • error is displayed when scanning image from gallery didn't work
  • added error handling in case no camera device exists

PR is based on #2176.

Before:

grafik
grafik
grafik

After:

grafik
grafik
grafik
grafik

Currently running run-android fails with this error:

Execution failed for task ':react-native-worklets-core:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-worklets-core:debugCompileClasspath'.
  > Could not find com.facebook.react:react-android:.
    Required by:
        project :react-native-worklets-core
  > Could not find com.facebook.react:hermes-android:.
    Required by:
        project :react-native-worklets-core

I tried several recommendations but nothing helped. Maybe a react-native update is necessary. So waiting for #1663.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (c-lightning-REST)
  • LndHub
  • [DEPRECATED] Core Lightning (Spark)
  • [DEPRECATED] Eclair

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the Zeus Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

@myxmaster
Copy link
Contributor Author

After merging the branch for updating react-native to 0.72.4 I get another error:

ld: error: undefined symbol: RNWorklet::JsiWorkletContext::getWorkletRuntime()

Seems like the vision-camera and barcode-scanner libs are too new and there are still problems to be fixed. We should wait until the libs are stable. The current QR code scanner lib has issues but mostly works, also for dense QR codes if the camera is close enough.

@myxmaster
Copy link
Contributor Author

react-native-vision-camera now can scan QR codes without additional libraries. Unfortunately it crashes sometimes when closing the camera (mrousavy/react-native-vision-camera#2147). Waiting for a new release to finish this.

@myxmaster
Copy link
Contributor Author

Fixed the problems and updated original post.

@myxmaster myxmaster marked this pull request as ready for review May 10, 2024 16:32
@kaloudis kaloudis added this to the v0.9.0 milestone May 22, 2024
@kaloudis kaloudis changed the title Replace react-native-camera-kit with react-native-vision-camera deps: Replace react-native-camera-kit with react-native-vision-camera May 22, 2024
@kaloudis
Copy link
Contributor

Hitting this issue on iOS

simulator_screenshot_D7C31228-29BF-417B-A451-1CD9E1C58191

@kaloudis kaloudis merged commit 0beba2b into ZeusLN:master May 22, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants