Closed zsajjad closed 5 years ago
By podspec do you mean Podfile? Can you share your Podfile? TextDetector is a static dependency and it looks like it's being linked twice into your project.
Update: it looks like GMV and React Native have a shared c++ dependency that's causing these symbol collisions. It's unlikely that there are good workarounds for this on your end, so you'll probably have to wait for a Firebase (or RN) fix.
I'll keep this issue updated.
I am trying to publish a wrapper for MLKit Vision for React Native. Here is the podspec.
I also tried
s.dependency 'Firebase/Core'
s.dependency 'Firebase/MLVision'
s.dependency 'Firebase/MLVisionTextModel'
My Project's Podfile looks like this:
platform :ios, '11.3'
target 'myApp' do
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
# See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'Core',
'CxxBridge',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'RNTextDetector', path: '../node_modules/react-native-text-detector/ios'
pod 'react-native-camera', path: '../node_modules/react-native-camera'
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path
# React Native third party dependencies podspecs
pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec"
# react-native-maps dependencies
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
end
end
Sorry any news on problem? I have the same problem with nativa app ios in swift. Any idea?
@rmusetti81 you should not be running into this issue when developing a native app in Swift. Please open a new issue with all of your build information (Podfile, Podfile.lock, CocoaPods version, Xcode version).
Hi @zsajjad ! I had the exact same issue using react native and I solved enabling the dead code stripping in xcode for debug. You can enable it in Target > Build Settings > search for "Dead code stripping". For now seems to work fine.
I made my own package that uses firebase ml vision on android and CoreML+TesseractOCR on ios!
@joan-domingo's solution works fine. For people looking here, you can use react-native-text-detector firebase branch as a wrapper around firebase ML Kit Vision.
I'm building an app with React Native that I've already "ejected" into its own native app project for iOS. I'm interested in using the new Firebase ML Kit Vision Text Detector for recognizing text in images using the on-device model, and I'm willing to write my own NativeModule wrapper for it (since it's so new, I don't see any existing wrappers in projects like react-native-firebase).
So, I used Cocoapods to bring in the Firebase dependencies, but when I try to compile the new workspace, I get the following linker error:
This issue appears when I add
'Firebase/MLVisionTextModel'
in podspecs. In case I don't add this as a dependency, it returns an empty array on the images having a good amount of text!