Michaelvilleneuve / react-native-perspective-image-cropper

Perform custom crop, resizing and perspective correction 📐🖼
MIT License
306 stars 127 forks source link

Cant get Open CV to work #4

Closed mikasjoman closed 7 years ago

mikasjoman commented 7 years ago

I get multiple issues when trying to add Open CV to my project. So my first error in XCode...

ld: framework not found opencv2 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I then tried to add it manually to the Build Phases > Link Binary with Libraries I get the follwing error

/Users/mika/Library/Developer/Xcode/DerivedData/JuliaStudy-civerreznbtmgwezznnemirozxxf/Build/Intermediates/JuliaStudy.build/Debug-iphonesimulator/JuliaStudy.build/Script-00DD1BFF1BD5951E006B06BC.sh: line 3: ../node_modules/react-native/packager/react-native-xcode.sh: No such file or directory

So... it would be really nice to have a solution with iOS Core graphics instead of Open CV.

Michaelvilleneuve commented 7 years ago

Actually adding openCV is normally pretty easy on iOS. The linker error is straightforward, there is a reference to the framework but it can't be found. You must add the opencv2.framework to both your main xcode project and the Library. Right click on your project, add files -> choose your opencv2.framework. Repeat with the Library/React-native-perspective-image-chopper folder.

The second error however does not seem to be related to this library at all.

If you want you can always try using the code referenced in #2. Put it in node_modules/react-native-perspective-image-cropper/ios/Customcropmanager.mm. Remove all the references to openCV and try to make work this way, you should just face orientation troubles. I can't work on it for now.

mikasjoman commented 7 years ago

Got it. I guess this has to do with me not being an iOS dev, I am just banging my head against the wall here :( I must be doing something stupid here, because my project builds when I remove the OpenCV framework and your module to XCode, but when I add them I get multiple different errors. I understand you don't have time to fix the iOS Core Graphics solution... do you think you would have time to record a 2 minute screen cast with quicktime and publish on Youtube on how you add this module to the project? Your module is the perfect solution to my app, but I am so stuck right now :(

Michaelvilleneuve commented 7 years ago

Tell me if this helps https://youtu.be/aZ8j_M_837Q

mikasjoman commented 7 years ago

Nope. Tried over and over and over again, and no luck. Sorry that I didn't answer, but I really wanted to put some hours down before I said I couldn't get it working. Some of the initial instructions differ from what I am able to do, for example I have to install the react-native-svg by "npm install --save react-native-svg && react-native link", but now I have issues with RNSVG giving me build failures. Have you tried to install this in a fresh RN project? To me it seems that you are showing this from an existing project. Cheers