rodgomesc / vision-camera-code-scanner

VisionCamera Frame Processor Plugin to read barcodes using MLKit Vision QrCode Scanning
MIT License
337 stars 222 forks source link

iOS 14.8.1 - Frame Processor threw an error: Can't find variable: __scanQRCodes #25

Open Twisterking opened 2 years ago

Twisterking commented 2 years ago

Hi there,

So we are currently implementing this great plugin! For some reason the exact same code works on one device (iPhone 6s with most up-to-date iOS 15.x), but does NOT work on a newer iPhone 12 Mini with iOS 14.8.1. The babel config is obviously the same - again: the whole code is exactly the same!

When running the project on latter device, the following error is thrown in the xCode logs:

[javascript] Frame Processor threw an error: Can't find variable: __scanQRCodes

Can anyone help? It is quite obvious that for some reason the global variable __scanQRCodes is somehow undefined, but how is that possible?

Thanks, best Patrick

rodgomescrn commented 2 years ago

That’s really weird issue, you can get any more erros from Xcode between those two devices?

rodgomescrn commented 2 years ago

you are running the version from this repo or from npm?

Twisterking commented 2 years ago

We are running the master branch from this repo here! Nope sorry no more logs. The camera opens properly, and 5 times per second this error occurs in the logs. No scanning happens whatsoever. In my opinion this has to be some problem with the babel setup?! Do you have any tips on further debugging?

Twisterking commented 2 years ago

So, little update: With a fresh build it suddenly works on the IP12 Mini. No idea why, we did not really change anything. When we have further infos I will post it here!

trta2352 commented 2 years ago

I had the same issue. Fixed it by using "react-native-reanimated": "2.3.0-beta.4",.

veris-kamaraj commented 2 years ago

add the babel config module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [ [ 'react-native-reanimated/plugin', { globals: ['scanCodes','scanFaces'], }, ],

],

};

and try to rebuild using xcode

fukemy commented 2 years ago

@veris-kamaraj not working to me, i dont know why, here is my babel file:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    // "@babel/plugin-proposal-decorators", { "legacy": true },
    ['react-native-reanimated/plugin',
      {
        globals: ['__scanCodes'],
      }
    ]
  ]
};

index.js:


import 'react-native-reanimated'
import {AppRegistry} from 'react-native'
import App from './App'
import 'react-native-image-keyboard'
import Realm from 'realm'
import uuid from 'react-native-uuid'
import {name as appName} from './app.json'
import messaging from '@react-native-firebase/messaging'
import RNCallKeep from 'react-native-callkeep'