I'm using the npm package react-native-perspective-image-cropper and it requires me to install opencv2. In the package's file, it imports opencv2, with the following:
#import <opencv2/opencv.hpp>
And no matter what I do I keep getting the following error:
'opencv2/opencv.hpp' file not found
I've read almost every article and question online and I just can't figure it out. I followed the installation steps provided in the article:
- I downloaded opencv2.framework from here and moved the file opencv2.framework into my
ios
folder. - Then in XCode, I right clicked on my project, choose add files and selected opencv2.framework
This is when I first got the error. I tried the following fixes to no avail:
- I tried to reinstall and relink the npm package that I was trying to use (I'm not using cocoa pods).
- I tried changing the import to be
#import "opencv2/opencv.hpp"
(replacing the brackets with parenthesis. - I tried adding opencv2.framework to
Link Binary with Library
underBuild Phases
- I tried adding opencv2.framework to
Copy Bundle Resources
underBuild Phases
- I changed
Always Search User Paths (Deprecated)
toyes
- I added a
Framework Search Path
of:$(inherited)
$(PROJECT_DIR)
$(PROJECT_DIR)/opencv2.framework
$(PROJECT_DIR)/./opencv2.framework
$(PROJECT_DIR)opencv2.framework
/usr/lib**
- I added a
Header Search Path
of:$(inherited)
$(PROJECT_DIR)
$(PROJECT_DIR)/opencv2.framework
$(PROJECT_DIR)/./opencv2.framework
$(PROJECT_DIR)opencv2.framework
/usr/lib**
- I tried moving
opencv2.framework
under theFramework
folder - I tried moving
opencv2.framework
directly under the package
I cleaned the product and rebuilt after each attempt and each attempt was attempted at least once (which you can imagine was a ton of fun).
Here are some of the sources I tried to use:
- 'opencv2/opencv.hpp' file not found
- hpp file in imported framework is not found by XCode
- Xcode can't find source files
- 'opencv2/opencv.hpp' file not found in my private pod
- opencv2/opencv.hpp file not found in Xcode (note this is different than #1)
- https://github.com/opencv/opencv/issues/5989
- https://github.com/kylemcdonald/ofxCv/issues/167
- https://forums.xilinx.com/t5/Vivado-High-Level-Synthesis-HLS/Cannot-find-quot-opencv2-opencv-hpp-quot/td-p/478368
- https://groups.google.com/forum/#!topic/caffe-users/Poteul9Rz20
- http://answers.opencv.org/question/34066/framework-not-found-opencv/
- https://github.com/iMicknl/cordova-plugin-openalpr/issues/12
I genuinely have no clue where to look at this point. Any help would be greatly appreciated. I can also post any updates if more information would be helpful.