zsajjad / react-native-text-detector

Text Detector from image for react native using firebase MLKit on android and Tesseract on iOS
MIT License
222 stars 60 forks source link

'FirebaseCore/FirebaseCore.h' file not found ios #10

Closed gmarcz closed 5 years ago

gmarcz commented 5 years ago

I want to use the firebase version of the library, but I can't get to build the project, always get some errors.

I created my project with expo like: expo init myproject Installed the firebase version of this module: npm install git+https://github.com/zsajjad/react-native-text-detector.git#firebase Then ejecting it: expo eject Changing the directory to ios and creating Podfile: pod init

Added these lines to the Podfile: pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'React', :path => '../node_modules/react-native' pod 'RNTextDetector', path: '../node_modules/react-native-text-detector/ios'

Then updating and installing the pods with: pod update, pod install

Opening the myproject.xcworkspace file and adding GoogleService-Info.plist and finally tried to build it, but got this error:

RNTextDetector.m

import <FirebaseCore/FirebaseCore.h> <= 'FirebaseCore/FirebaseCore.h' file not found

And I see some other errors as well, in the RNTextDetector > RCTBridgeModule.h:

typedef struct RCTMethodInfo { <= Redefinition of 'RCTMethodInfo'

What do I miss ?

anjanaNewput commented 5 years ago

@gmarcz @zsajjad I also get this error and follow the same steps as mentioned in the issue. Please help me to resolve this. Thanks in advance.

gmarcz commented 5 years ago

Hi @anjanaNewput I created a new fork https://github.com/gmarcz/react-native-text-detector and made some changes over there and updated the readme, so I will not repeat it here :)

Only one thing I left out there, first time when you build the app you may get some errors:

error: 
  node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc
  node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc
  node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc
  node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc

to fix these you need to execute these commands:

cd node_modules/react-native/scripts
./ios-install-third-party.sh
cd ../third-party/glog-0.3.5
../../scripts/ios-configure-glog.sh

I hope this helps.

zsajjad commented 5 years ago

@gmarcz you could have used firebase branch for this