rodgomesc / vision-camera-code-scanner

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

'VisionCamera/FrameProcessorPlugin.h' file not found #62

Open moygospadin opened 2 years ago

moygospadin commented 2 years ago

i have following package json
"@expo/react-native-action-sheet": "^3.13.0", "@gorhom/bottom-sheet": "^4", "@gorhom/portal": "^1.0.13", "@react-native-async-storage/async-storage": "^1.16.1", "@react-native-community/blur": "^3.6.0", "@react-navigation/bottom-tabs": "^6.2.0", "@react-navigation/native": "^6.0.8", "@react-navigation/native-stack": "^6.5.0", "@rneui/base": "^4.0.0-rc.1", "@rneui/themed": "^4.0.0-rc.1", "@types/lodash.isequal": "^4.5.5", "@types/react-native-snap-carousel": "^3.8.5", "axios": "^0.26.0", "buffer": "^6.0.3", "date-fns": "^2.28.0", "form-data": "^4.0.0", "formik": "^2.2.9", "i18next": "^21.6.12", "i18next-http-backend": "^1.4.0", "lodash.clonedeep": "^4.5.0", "lodash.debounce": "^4.0.8", "lodash.isempty": "^4.4.0", "lodash.isequal": "^4.5.0", "mobx": "^6.4.2", "mobx-devtools-mst": "^0.9.30", "mobx-react-lite": "^3.3.0", "mobx-state-tree": "^5.1.3", "qs": "^6.10.3", "querystring": "^0.2.1", "react": "17.0.2", "react-i18next": "^11.15.5", "react-native": "0.68.0", "react-native-compressor": "^1.5.2", "react-native-config": "^1.4.5", "react-native-currency-input": "^1.0.1", "react-native-date-picker": "^4.2.0", "react-native-flash-message": "^0.2.1", "react-native-fs": "^2.19.0", "react-native-gesture-handler": "^2.4.2", "react-native-image-picker": "^4.7.3", "react-native-network-logger": "^1.12.0", "react-native-permissions": "^3.3.1", "react-native-photo-editor": "1.0.13", "react-native-reanimated": "^2.6.0", "react-native-safe-area-context": "^4.0.1", "react-native-screens": "^3.12.0", "react-native-shake": "^5.1.1", "react-native-snap-carousel": "^3.9.1", "react-native-svg": "^12.1.1", "react-native-table-component": "^1.2.2", "react-native-text-size": "^4.0.0-rc.1", "react-native-url-polyfill": "^1.3.0", "react-native-vision-camera": "^2.13.1", "react-native-web": "^0.17.7", "react-query": "^3.34.16", "vision-camera-code-scanner": "^0.2.0", When i trying to build react native ios i have following error 'VisionCamera/FrameProcessorPlugin.h' file not found in VisionCameraCodeScanner-Bridging-Header.h file Xcode Version 13.3 (13E113)

calderaro commented 2 years ago

did you found a solution for this? im having exactly the same error : "'VisionCamera/FrameProcessorPlugin.h' file not found"

ArturoTorresMartinez commented 2 years ago

Same issue here

NicoHinderling commented 2 years ago

same here as well. Tried cleaning the build folder, restarting watchman, yarn starting with --reset-cache and re-creating the Pods, but still facing this issue

edit: I resolved it locally. I believe it was because I was missing react-native-vision-camera as an import

s5z6 commented 2 years ago

Same issue on RN 0.69.1 with use_frameworks! (react-native-firebase > v15 requires it) in podfile

sb8378 commented 2 years ago

same here as well. Tried cleaning the build folder, restarting watchman, yarn starting with --reset-cache and re-creating the Pods, but still facing this issue

edit: I resolved it locally. I believe it was because I was missing react-native-vision-camera as an import

Can you please elaborate a bit? Where to import react-native-vision-camera?

janet-rivas commented 2 years ago

I have the same issue - @react-native-firebase > 15 requires use_frameworks! in the podfile vision-camera-code-scanner/VisionCameraCodeScanner-Bridging-Header.h and VisionCameraCodeScanner.m

DentVega commented 2 years ago

Same issue here

JulianErnest commented 2 years ago

I believe this has something to do with use_frameworks! for the firebase pods.

So instead I added these lines in the Podfile.

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  $RNFirebaseAsStaticFramework = true

And inside post_install do |installer|

    # TEMPORARY FIX UNTIL FIX IS RELEASED IN REACT NATIVE
    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
        # For third party modules who have React-bridging dependency to search correct headers
        config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
      end
    end
gturyz commented 2 years ago

Same issue here

pehoracek commented 2 years ago

I have the same issue

thelastwizardOC commented 2 years ago

Same issue here

benedusi commented 2 years ago

I encountered the same issue, but I don't use use_frameworks! and it seems to work fine on an intel machine, but fails on Mac m1

IKyriazis commented 2 years ago

having the same issue, on M1 arch

IKyriazis commented 2 years ago

sadly I am getting this on intel too :( anyone who knows how to fix this please give instructions or resources

Maorshl commented 2 years ago

I have this issue too, and will be glad if anyone can give a solution.

gelodgreat commented 2 years ago

Also encountered this with firebase v15 and react native 0.70, Any possible workarounds on this?

saravanaS2108 commented 2 years ago

The same issue with firebase v15.7.0 and react native 0.69.3, Any possible workarounds on this?

Maorshl commented 2 years ago

I downgraded firebase to v14.2.0 and changed the podfile to be without the use_frameworks!. it worked for me.

vitormomberg commented 2 years ago

The same issue with react native 0.69.5, Any possible workarounds on this?

jorgebrunetto commented 2 years ago

The same issue with react native 0.69.5, Any possible workarounds on this?

MMYurt commented 2 years ago

Since use_frameworks is being used, we have to define these libraries as static. The workaround in Podfile works for me.

I've put that just above use_react_native!

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end
vitormomberg commented 2 years ago

@MMYurt it does not works for me.

Now I have a new error :/

-U and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together in target 'RCT-Folly' from project 'Pods'

brynjagr commented 2 years ago

@MMYurt it does not works for me.

Now I have a new error :/

-U and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together in target 'RCT-Folly' from project 'Pods'

Bitcode has been deprecated in Xcode 14 and App Store no longer accepts bitcode submissions.

You should try to disable it: Set Enable Bitcode to No under target Build Settings in Xcode.

vitormomberg commented 2 years ago

@brynjagr I've tried this, but error persists :/

MMYurt commented 2 years ago

@brynjagr I've tried this, but error persists :/

I had got this error as well and added the script below into post_install

  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['ENABLE_BITCODE'] = 'NO'
      end
    end

After that, it was continuing to gives different errors. I choose to downgrade firebase version to v14 and deleted use_frameworks

KonstantinZhukovskij commented 2 years ago

any news here?

brenodt commented 2 years ago

I've also started having this issue after following the @react-native-firebase/app setup guide.

In going through the steps outlined here to have a clean install of the dependencies:

rm -rf package-lock.json && rm -rf yarn.lock && rm -rf node_modules
rm -rf ios/Podfile.lock && rm -rf ios/Pods
npm i  # or "yarn"
cd ios && pod repo update && pod update && pod install

I get the following error in the last step:

[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
  In Podfile:
    RNFBAuth (from `../node_modules/@react-native-firebase/auth`) was resolved to 15.7.1, which depends on
      Firebase/Auth (= 10.0.0) was resolved to 10.0.0, which depends on
        FirebaseAuth (~> 10.0.0) was resolved to 10.0.0, which depends on
          GTMSessionFetcher/Core (~> 2.1)

    vision-camera-code-scanner (from `../node_modules/vision-camera-code-scanner`) was resolved to 0.2.0, which depends on
      GoogleMLKit/BarcodeScanning was resolved to 0.60.0, which depends on
        GoogleMLKit/MLKitCore (= 0.60.0) was resolved to 0.60.0, which depends on
          MLKitCommon (~> 0.60.0) was resolved to 0.60.0, which depends on
            GTMSessionFetcher/Core (~> 1.1)

Updating my package.json to depend on react-native-firebase v14 with:

"@react-native-firebase/app": "^14.12.0",
"@react-native-firebase/auth": "^14.12.0",
// other react-native-firebase packages...

As well as removing the use_frameworks! line from my Podfile (as described here) seems to have done the trick (after I clean installed everything again), allowing the application to compile.

Maybe updating the GoogleMLKit/BarcodeScanning dependency on this package would resolve the conflict with the newer react-native-firebase?

rahulunni73 commented 1 year ago

demo

Am also facing the issue, don't know what to do next, i tried all the suggestion as said in the discussions here, but not able to overcome the issue kindly help me.

in pod file i included the following

pre_install do |installer| installer.pod_targets.each do |pod| if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera') def pod.build_type Pod::BuildType.static_library end end end end

$RNFirebaseAsStaticFramework = true

post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"

  end
end

end end use_frameworks! :linkage => :static

i also use rn firebase also for crashlytics & messaging

my react native info

System: OS: macOS 13.0 CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz Memory: 36.14 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.19.3 - ~/Work/MyProject/DLBProjeect/OspynDLB_V1.0/node_modules/.bin/npm Watchman: 2021.10.18.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 17.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.2 => 0.66.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Bamorem commented 1 year ago

did someone found a solution about it ?

Bamorem commented 1 year ago

target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' end

This works for me but after this i got another error saying :

/Users/username/Library/Developer/Xcode/DerivedData/name/Build/Products/Debug-iphonesimulator/FirebaseFunctions/FirebaseFunctions.framework/Headers/FirebaseFunctions-Swift.h:450:2 Unsupported Swift architecture /Users/username/Library/Developer/Xcode/DerivedData/name/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework/Headers/FirebaseStorage-Swift.h:828:2 Unsupported Swift architecture

panpan31415 commented 1 year ago

demo

Am also facing the issue, don't know what to do next, i tried all the suggestion as said in the discussions here, but not able to overcome the issue kindly help me.

in pod file i included the following

pre_install do |installer| installer.pod_targets.each do |pod| if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera') def pod.build_type Pod::BuildType.static_library end end end end

$RNFirebaseAsStaticFramework = true

post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle" target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"

  end
end

end end use_frameworks! :linkage => :static

i also use rn firebase also for crashlytics & messaging

my react native info

System: OS: macOS 13.0 CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz Memory: 36.14 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.0 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.19.3 - ~/Work/MyProject/DLBProjeect/OspynDLB_V1.0/node_modules/.bin/npm Watchman: 2021.10.18.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 17.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.2 => 0.66.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

I have exactly same issue here, is there any update?

deflexable commented 1 year ago

it almost a year now and no solution, pretty sad 🫤

AND-GORNIY commented 1 year ago

In my case I only installed npm i vision-camera-code-scanner , then I also installed react-native-vision-camera, and build run, seems react-native-vision-camera is dependency for vision-camera-code-scanner but nevertheless.

Frission commented 1 year ago

This issue is preventing me from using this library at work, I've tried the podfile solutions above to no avail. It looks like this PR here might fix this when it's done, Would there be any chance to backport this to v2?

The podfile fixes above actually solves the problem of header not being found but then I get around 51 build errors of "Undefined symbol: ...something firebase related", which I haven't been able to fix

ghost commented 1 year ago

I also stuck with this issue after updating xcode to 14.3 and adding use_frameworks! to Podfile ios/VisionCameraCodeScanner-Bridging-Header.h:4:9 'VisionCamera/FrameProcessorPlugin.h' file not found

mengheangrat commented 1 year ago

Since use_frameworks is being used, we have to define these libraries as static. The workaround in Podfile works for me.

I've put that just above use_react_native!

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

It worked for me.

huzaifaazim0 commented 1 year ago

Found a solution

The problem is using this use_frameworks! in your PodFile most people are using use_frameworks! due to firebase v15+ requirement

so if you are using use_frameworks! for any reason remove it and use :module_headers => true instead for each library due to which you used use_frameworks! earlier

in case of firebase, after remover use_frameworks! you can add the following line at the end of Podfile

pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true

you might need to turn off flipper too by commenting out this following line (for firebase, not sure about any other library) :flipper_configuration => flipper_config,

This should work fine. now you will be able to use your frame processors.

Hope that helps

oguzydz commented 1 year ago

I believe this has something to do with use_frameworks! for the firebase pods.

So instead I added these lines in the Podfile.

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  $RNFirebaseAsStaticFramework = true

And inside post_install do |installer|

    # TEMPORARY FIX UNTIL FIX IS RELEASED IN REACT NATIVE
    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
        # For third party modules who have React-bridging dependency to search correct headers
        config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
      end
    end

This is not effective bcz I need to check with all npm modules.

vuongnh1705 commented 1 year ago

Since use_frameworks is being used, we have to define these libraries as static. The workaround in Podfile works for me.

I've put that just above use_react_native!

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

It worked for me, thank you

MiteshKalal7 commented 1 year ago

I believe this has something to do with use_frameworks! for the firebase pods.

So instead I added these lines in the Podfile.

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  $RNFirebaseAsStaticFramework = true

And inside post_install do |installer|

    # TEMPORARY FIX UNTIL FIX IS RELEASED IN REACT NATIVE
    installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
      target_installation_result.native_target.build_configurations.each do |config|
        # For third party modules who have React-bridging dependency to search correct headers
        config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
        config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
      end
    end

yeah it is working

marklanham commented 1 year ago

This is kind of obvious but I think the installation instructions aren’t great. It’s true, you also need react-native-vision-camera as a dependency as well, it would be easy just to mention this in the setup instructions.

I also had to downgrade react-native-reanimated to v2.14.4 to get the build working. However I'm now running into another issue where .globals is not a valid Plugin property in the babel.config.js file.

suwu150 commented 1 year ago

https://github.com/mrousavy/react-native-vision-camera/issues/1987

erickcrus commented 1 year ago

this lib needs to be updated with V3... https://github.com/mrousavy/react-native-vision-camera/issues/1987#issuecomment-1759411150 That solution works for me: https://github.com/rodgomesc/vision-camera-code-scanner/pull/165/commits/eac4f996e8507353d5bb85eac175227ed5b2f407 pull request: https://github.com/rodgomesc/vision-camera-code-scanner/pull/165