React-native-image-crop-picker: fatal error: 'QBImagePickerController/QBImagePickerController.h' file not found

Created on 23 Aug 2017  路  9Comments  路  Source: ivpusic/react-native-image-crop-picker

Version

  • react-native-image-crop-picker v0.15.3
  • react-native v0.40.0

Platform

iOS

Expected behaviour

It should build

Actual behaviour

It's not building, the error message is:

fatal error: 'QBImagePickerController/QBImagePickerController.h' file not found
#import "QBImagePickerController/QBImagePickerController.h"

I have followed the steps to install the plugin, I have embedded the two Frameworks (RSKImageCropper.framework and QBImagePicker.framework) as described in the manual

Most helpful comment

I just spent the last four hours trying to get this to work. Installed cocaopods and that caused other issues, even followed #414 with no luck.

Got it to work by doing the following:
Unlinked this package:
react-native unlink react-native-image-crop-picker
Uninstalled this package:
npm uninstall --save react-native-image-crop-picker

Uninstalled Pods using:
https://github.com/CocoaPods/cocoapods-deintegrate

Installed & linked:
npm i --save [email protected]
react-native link react-native-image-crop-picker

Drag and dropped the ios/ImageCropPickerSDK folder from the folder in node_modules/react-native-image-crop-picker to the Frameworks folder in my xcode project. Important: Make sure Copy items if needed IS ticked!

Instead of: Under Embedded Binaries click + and add RSKImageCropper.framework and QBImagePicker.framework. I just dragged the frameworks from my Frameworks folder onto the Embedded Binaries area. The frameworks appear twice in the Linked Frameworks and Libraries section. This seems to be fine as it is now compiling and working in the App.

Hope this helps.

All 9 comments

I highly recommend to use cocoapods to install external dependencies. Please try it.

Please refer to #414 for cocoapods instructions

I downgraded to 0.15.1. Not sure how to do the cocoapods stuff, and I don't really want to use cocoapods.

I agree with @ujwal-setlur I'd rather not have to introduce cocoapods just to use this package.

I just spent the last four hours trying to get this to work. Installed cocaopods and that caused other issues, even followed #414 with no luck.

Got it to work by doing the following:
Unlinked this package:
react-native unlink react-native-image-crop-picker
Uninstalled this package:
npm uninstall --save react-native-image-crop-picker

Uninstalled Pods using:
https://github.com/CocoaPods/cocoapods-deintegrate

Installed & linked:
npm i --save [email protected]
react-native link react-native-image-crop-picker

Drag and dropped the ios/ImageCropPickerSDK folder from the folder in node_modules/react-native-image-crop-picker to the Frameworks folder in my xcode project. Important: Make sure Copy items if needed IS ticked!

Instead of: Under Embedded Binaries click + and add RSKImageCropper.framework and QBImagePicker.framework. I just dragged the frameworks from my Frameworks folder onto the Embedded Binaries area. The frameworks appear twice in the Linked Frameworks and Libraries section. This seems to be fine as it is now compiling and working in the App.

Hope this helps.

guys sorry for having troubles. I am pretty busy and didn't have time to participate in the discussion.

One of recent PR broke cocoa-pods, but it should be working now if you pull the latest release (0.16.0).

I also updated readme with step by step tutorial how to integrate cocoa-pods and how to use it to install external dependencies. Please refer to following readme section for more details. https://github.com/ivpusic/react-native-image-crop-picker#step-2.

I sent the PR for integrating with cocoapods. I just found out people are having issues with it. In ImageCropPicker.h there are conditional macros that include headers depending on whats available. This conditional checking is done as

#if __has_include("QBImagePicker.h")
#import "QBImagePicker.h"
#import "RSKImageCropper.h"
#elseif __has_include("QBImagePicker/QBImagePicker.h")
#import "QBImagePicker/QBImagePicker.h"
#import <RSKImageCropper/RSKImageCropper.h>
#else
#import "QBImagePickerController/QBImagePickerController.h"
#import <RSKImageCropper/RSKImageCropper.h>
#endif

#elseif and #elif are supposed to behave identically. In this case #elseif is not working, replacing it with #elif does the trick.

+1

will close this issue now. For all people who are having a similar problem, please upgrade to latest version and follow https://github.com/ivpusic/react-native-image-crop-picker#step-2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

althurzard picture althurzard  路  3Comments

xuchao321 picture xuchao321  路  3Comments

aterribili picture aterribili  路  3Comments

sergiulucaci picture sergiulucaci  路  3Comments

DISKONEKTeD picture DISKONEKTeD  路  3Comments