Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS build failed with QBImagePicker/QBImagePicker.h file not found #105

Closed
max-vasin opened this issue Oct 11, 2016 · 18 comments
Closed

iOS build failed with QBImagePicker/QBImagePicker.h file not found #105

max-vasin opened this issue Oct 11, 2016 · 18 comments

Comments

@max-vasin
Copy link

Version

  • react-native-image-crop-picker v0.9.7
  • react-native v0.33.1

Platform

  • iOS

Expected behaviour

Successful build without any modifications.

Actual behaviour

Maybe i missed something, but build failed with

QBImagePicker/QBImagePicker.h file not found. 

When i changed the value of Framework Search Paths for imageCropPicker build target to

$(PROJECT_DIR)/RSKImageCropper/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
$(PROJECT_DIR)/QBImagePicker/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

then i got successful build.

Steps to reproduce

  • npm install react-native-image-crop-picker on empty project
  • react-native link
  • add RSKImageCropper.framework & QBImagePicker.framework both to Embedded Binaries & Linked Frameworks and Libraries
  • add
${PROJECT_DIR}/../node_modules/react-native-image-crop-picker/ios/QBImagePicker/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
${PROJECT_DIR}/../node_modules/react-native-image-crop-picker/ios/RSKImageCropper/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

to Framework Search Paths for react-native project

  • build for simulator or device
  • failure
@ivpusic
Copy link
Owner

ivpusic commented Oct 12, 2016

cannot reproduce this. Did react-native link react-native-image-crop-picker throw any errors?

@max-vasin
Copy link
Author

Did react-native link react-native-image-crop-picker throw any errors?

No. In fact, i don't perform react-native link on every build (automated). I have already linked ios react-native xcode project in git. I have tried to relink today - the problem still appears. Currently i wrote a patch script to set framework search paths in ImageCropPicker.xcodeproj just after npm install. It works, but ugly. Maybe something wrong with a version of something...

Another way to reproduce same issue.

  • rm -rf node_modules
  • npm install ("react-native-image-crop-picker": "^0.9.7" within package.json)
  • open node_modules/react-native-image-crop-picker/ios/ImageCropPicker.xcodeproj in Xcode (currenlty i have Version 8.0 (8A218a))
  • pick target imageCropPicker (static library)
  • build
  • :(

@ivpusic
Copy link
Owner

ivpusic commented Oct 13, 2016

my suggestion...use cocoapods to get these dependencies. Check readme file. It will be much easier

@max-vasin
Copy link
Author

Migrating to cocoapods reveals real problem. It is not with this component but with auto-created schemes in Xcode. If you open Xcode just after installing npm packages and pods - everything will be fine. But if you use xcodebuild without opening Xcode - things goes bad.

Adding ruby script to recreate user schemes just before xcodebuild seems to resolve this problem, but very ugly. No matter, this does not related to this component. Thanks for helping.

@kelset
Copy link

kelset commented Nov 3, 2016

I had a similar issue, with the RSKImageCropper header. The explanation provided by @max-vasin is correct.

@kelset
Copy link

kelset commented Dec 2, 2016

Unluckily, this issue keeps resurfacing for me, so for future me and other people that may find this issue (tbh I think @ivpusic you should try to understand why this happens - apparently something breaks after every time I Archive the xcode project)

So, for me to solve this issue the "definitive" list of things to do is:

  1. in XCode, run both Clean and Clean Folder...
  2. close XCode
  3. Remove the DerivedData folder of the related project (in <user>/Library/Developer/Xcode/DerivedData )
  4. from command line, in the project folder, run react-native unlink react-native-image-crop-picker
  5. in <project folder>/ios remove the Pods folder and the pod lock file
  6. in <project folder> remove the nome_modules folder and the yarn.lock file
  7. Empty recycle bin
  8. run sudo yarn
  9. chmod 777 the node_modules folder
  10. go into <project folder>/ios and run a pod install
  11. from command line, in the project folder, run react-native link react-native-image-crop-picker
  12. Open Xcode
  13. Wait for indexing process to be over

Hope this helps, cheers.

@rogerkerse
Copy link

The problem still exists. @kelset solution kind of worked, but it does not seem like a sustainable solution.

@kelset
Copy link

kelset commented Jan 25, 2017

Keeps happening to me too.
Today, I did all the procedure I listed above (thanks, past me) but I still got the error. I closed and reopened Xcode, re run the Archive command without doing anything else, and this time it worked. I'm baffled.

@rogerkerse
Copy link

this solution helped out once again.. it happens all the time.. very difficult to use this library conveniently because of this

@jr-k
Copy link

jr-k commented Feb 13, 2017

I'm using cocoapods. I got this issue, then I closed xcode then re-opened it and it worked.

@varungupta85
Copy link

This is really weird. I start to see this issue now out of now where for RSKImageCropper.h file. I have run this successfully for more than 100 times and started to get this issue now. Tried cleaning the project, reopening Xcode, reboot the machine (old windows user :)) but no help. I wanted to check if there someone has find a more definitive solution to this problem before trying out other things such as removing the package etc. Weird thing is that I can control click the file and it opens the RSKImageCropper.h file. So, Xcode is able to find and resolve the file name but not during archiving.

@rogerkerse
Copy link

Any updates on such an old issue that still keeps happening every time?

@zkrige
Copy link
Contributor

zkrige commented Jul 19, 2017

I deleted my schemes then autorecreated them and it seemed to fix the problem

@administerspice
Copy link

administerspice commented Aug 18, 2017

This happens most often when archiving, even when the project builds and runs normally. Seems intermittent. Starting over from pod install, archiving will succeed one out of about twenty times... 😢

@uusa35
Copy link

uusa35 commented Mar 13, 2018

still i am suffering for this package .. any help ? !

@garydevenay
Copy link

I've been suffering from this issue too. Is there any intention of this being fixed - or an alternative that's not causing headaches?

@wikieswan
Copy link

i try all methods on internet, but failed.
unstare this repo
remove react-native-image-crop-picker from my project clear
use react-native-image-picker instate

@diegolmello
Copy link

After get the lib working with manual linking, I tried to release a feature with it.
I use fastlane, so it was a big mess.
Then I removed and installed via cocoapods, but I was still getting errors.
I fixed it by making sure manual linking was completely removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests