vision-camera-code-scanner icon indicating copy to clipboard operation
vision-camera-code-scanner copied to clipboard

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

Open Twisterking opened this issue 3 years ago • 7 comments

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

Twisterking avatar Dec 02 '21 17:12 Twisterking

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

rodgomescrn avatar Dec 03 '21 04:12 rodgomescrn

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

rodgomescrn avatar Dec 03 '21 04:12 rodgomescrn

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 avatar Dec 03 '21 07:12 Twisterking

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!

Twisterking avatar Dec 03 '21 09:12 Twisterking

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

trta2352 avatar Jan 21 '22 14:01 trta2352

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

veris-kamaraj avatar Jan 27 '22 10:01 veris-kamaraj

@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'

fukemy avatar Sep 14 '22 14:09 fukemy