zsajjad / react-native-text-detector

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

React/RCTBridge.h file not found // ios #2

Closed soulmecca closed 6 years ago

soulmecca commented 6 years ago

Hi, thanks for this great library.

I tried to implement this but with no luck. To replicate:

  1. react-native init myApp then cd myApp.
  2. npm install react-native-text-detector --save
  3. added language file in the folder 'tessdata' in ios folder
  4. add 'pod 'RNTextDetector', path: '../node_modules/react-native-text-detector/ios' ' to podfile
  5. pod install.
  6. build the app with the file xcworkspace in Xcode.
  7. Got this error 'React/RCTBridge.h' file not found. It seems it happened in the file RNTextDetector.m in line 4.

Do you know how to solve this or what I have done wrong?

Thanks a lot for your help in advance.

zsajjad commented 6 years ago

Can you please share your Podfile here. Please check this Podfile of sample app. Also, there is a sample project you can check for reference. Hope it helps.

soulmecca commented 6 years ago

Hi, thanks for your response. Here is what I got.

First I tried the sample project by git cloning, npm installing and then pod installing. I can start the app by deploying it on iPhone but RNTextDetector.detectFromUri function always returns false whatever I scan.

I also tried to build an application only with this plugin with the same contents of the podfile as the sample project. ( by react-native init ) When trying to build the application with Xcode I got this error

 ld: -weak_library and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I changed Enalbe Bitcode Build setting to No then I can run the applition on my device but got all these errors from logs

Unhandled JS Exception: undefined is not an object (evaluating 'CameraManager.Aspect')
[error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
Module AppRegistry is not a registered callable module (calling runApplication)
[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)
Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

I did not write any code. This is a plan state only with this plugin. Do you know why this is happening ??

zsajjad commented 6 years ago

About that enable bitcode, you have to set it to NO for iOS, its required bt Tesseract. About camera aspect, sample app won't work on simulator rather it will work on device since simulators don't have camera.

zsajjad commented 6 years ago

Closing this issue, due to inactivity. Please feel free to reopen if its not resolved yet.