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

Expo: iOS Build #21

Open
spsaucier opened this issue Dec 20, 2024 · 1 comment
Open

Expo: iOS Build #21

spsaucier opened this issue Dec 20, 2024 · 1 comment

Comments

@spsaucier
Copy link

spsaucier commented Dec 20, 2024

I had this working on a bare RN app, but I'm trying to migrate it to Expo now, and it's no longer building on iOS.

It gives this error:

› Copying   VehoDrivers Google-Maps-iOS-Utils/GoogleMapsUtils.framework/Headers/GMSMarker+GMUClusteritem.h ➜ ios/Pods/Google-Maps-iOS-Utils/Sources/GoogleMapsUtilsObjC/include/GMSMarker+GMUClusteritem.h

❌  (node_modules/vision-camera-ocr/ios/VisionCameraOcr-Bridging-Header.h:4:9)

  2 | #import <React/RCTViewManager.h>
  3 |
> 4 | #import <VisionCamera/FrameProcessorPlugin.h>
    |         ^ 'VisionCamera/FrameProcessorPlugin.h' file not found
  5 | #import <VisionCamera/Frame.h>
  6 |
  7 |

RN Vision Camera version:
"react-native-vision-camera": "^4.6.3",

I'm using expo-devlauncher and this setup in app.config.ts:

      [
        'react-native-vision-camera',
        {
          enableCodeScanner: true,
          cameraPermissionText:
            'We need access to your camera for scanning barcodes and taking pictures of your drop-offs.',
        },
      ],

I've also tried adding these to expo-build-properties (also tried without):

      [
        'expo-build-properties',
        {
          ios: {
            useFrameworks: 'static',
            buildSettings: {
              VisionCamera: {
                buildType: 'static_library',
              },
              'vision-camera-code-scanner': {
                buildType: 'static_library',
              },
            },
          },
        },
      ],

I'm using the branch which has TextRecognition set to 6.0.0, but I don't think that is related to this error (it was necessary for getting this far in the build).

Any ideas about how I can resolve this?

@kevenson
Copy link

kevenson commented Dec 23, 2024

I was having a similar issue. In my case, it was related to the use_frameworks! Podfile requirement for Firebase. The fix is here: rodgomesc/vision-camera-code-scanner#62

In the Podfile, I added the fix below after the use_frameworks lines, which worked.

  use_frameworks! :linkage => :static
  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

  # vision camera fix
  # some indication the use_frameworks keyword is causing issues
  # see: https://github.com/rodgomesc/vision-camera-code-scanner/issues/62
  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('VisionCameraOcr') || 
         pod.name.eql?('VisionCamera')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

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

2 participants