Closed khanakia closed 9 months ago
Please share the "npx react-native info" command output, package.json and podfile
I have uploaded a test repo here https://github.com/khanakia/BarcodeScannerTest
➜ BarcodeScannerTest git:(main) npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 13.5
CPU: (10) arm64 Apple M1 Max
Memory: 14.53 GB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.17.1
path: ~/.nvm/versions/node/v18.17.1/bin/node
Yarn:
version: 1.22.19
path: /usr/local/bin/yarn
npm:
version: 9.6.7
path: ~/.nvm/versions/node/v18.17.1/bin/npm
Watchman:
version: 2023.08.28.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.13.0
path: /Users/khanakia/.rvm/gems/ruby-2.7.7/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 20.0.2
path: /usr/bin/javac
Ruby:
version: 2.7.7
path: /Users/khanakia/.rvm/rubies/ruby-2.7.7/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.5
wanted: 0.72.5
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: true
Test repo is working fine below is the screenshot (You just missed the installation of react-native-permissions)
Yes i am able to run now
@khanakia I think you don't setup the react native permissions that why you facing this issue?
Yes it's working now but another issue is it's not able to scan all the barcodes As you can see below screenshot i am able to scan EID and MEID but it's not scanning IMEI and IMEI2
Let me check is this AVFoundation support these type of Barcodes.
Barcode scanning work properly even with IMEI & 2 (CODE 128 type of barcode)
Strange. I am testing with iPhone 13 Pro Camera it only scans MEID and EID, not the IMEI
I have confirmed with different Phone Imei Barcode it just gives this error when i scan via iPhone 13
2023-09-25 23:21:51.859975+0530 BarcodeScannerTest[50051:8125391] SocketStream read error [0x283118000]: 1 54
Just a note Do you provide some kind of Paid support to help us solve the problem if possible ?
Thanks, Pushpender
@khanakia Thank you for sharing the log. I'll thoroughly investigate and debug the issue. If you happen to discover a solution, please feel free to submit a pull request. While I genuinely appreciate your offer of paid support, it won't be necessary at this time.
If you happen to be available over call tomorrow if possible i can share you my screen and show you the issue may be that will help also check in another iPhone too
You can provide me the screen recording.
I will do. Also, i just tried this app https://github.com/alfianlosari/BarcodeTextScannerSwiftUI and it worked fine It seems they are using Vision Kit not 100% sure
You can provide me the screen recording.
Here's the video https://i.analyzify.app/QwuBQOZv
you will be able to see it scans the EID and MEDI only
@pushpender-singh-ap I have checked many other libraries react-native-camera-kit, react-native-camera v2, expo-barcode-scanner etc. All of them also not working also for the IMEI scan but i also used some native apps like above i sent you which are using Apple Vision Kit
so they are working.
It has to do with something or some bug within not Avfoundation
maybe
@khanakia I was try to add vision kit but it's failed because in vision kit apple not provide the objective-c documentation for DataScannerViewController.
Hi DataScannerViewController
is only available for Swift we can try to use this https://developer.apple.com/documentation/visionkit/vndocumentcameraviewcontroller or VNDocumentCameraScan
Hello @khanakia , could you kindly clone this repository: https://github.com/pushpender-singh-ap/react-native-nativeios-scanner and attempt to scan the IMEI barcode? Unfortunately, I don't currently have access to any iPhone devices, so I'm unable to test it myself at the moment. Your assistance would be greatly appreciated!
Also pod install was giving error so first i did bundle install
and then ran RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
Getting this error while building
@khanakia Can you compile for Simulator because i was build on Simulator it's working correctly but not sure about the real-device.
same error
ld: library not found for -ld_classic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It has to do something with this because when i compare this with the New React project there are no flags i could find -Wl -ld_classic
Run this command in you rootProject
yarn add ./react-native-nativeios-scanner && cd .. && node react-native-nativeios-scanner/node_modules/react-native/scripts/generate-codegen-artifacts.js \ --path react-native-nativeios-scanner/ \ --outputPath react-native-nativeios-scanner/react-native-nativeios-scanner/generated/
after this cd project and ios run
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
I am not using the module in my project i simply ran the command inside this repo root https://github.com/pushpender-singh-ap/react-native-nativeios-scanner
Getting error
node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module '/Users/khanakia/react-native-nativeios-scanner/node_modules/react-native/scripts/generate-codegen-artifacts.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.17.1
I was able to install the app after i removed the below flags
"-Wl",
"-ld_classic",
"-Wl",
"-ld_classic",
But i do not see any camera and also i tried clicking Start Scanning button
@khanakia Thanks for the update i will check this why it's happening.
For now i have created a custom module in OLD Arch https://github.com/khanakia/react-native-barcodeoldarch as i needed this urgently.
Once you are able to complete your module i will replace it with yours.
Thanks @pushpender-singh-ap
I installed a fresh application and it ran fine after that I followed the instructions to install the scanner app.
Once i installed the package now i could not build anymore
I believe it's related to this issue https://stackoverflow.com/questions/76721082/react-native-error-build-input-file-cannot-be-found-node-modules-react-nativ