React-native-image-crop-picker: ImagePicker is undefined (using custom xxconfig)

Created on 1 Jun 2018  Â·  10Comments  Â·  Source: ivpusic/react-native-image-crop-picker

Version

Tell us which versions you are using:

  • react-native-image-crop-picker v0.20.3
  • react-native v0.55.2

Platform

Tell us to which platform this issue is related

  • iOS with cocoapods
  • i have a custom xxconfig where i import #include "Pods/Target Support Files/Pods-Pairs/Pods-Pairs.debug.xcconfig" but i am not sure if its related

Expected behaviour

ImagePicker is not undefined

Actual behaviour

ImagePicker is undefined

Steps to reproduce

  1. use cocoapods installation

  2. build and run on a device

  3. import ImagePicker from 'react-native-image-crop-picker'

Attachments

// stacktrace or any other useful debug info

Love react-native-image-crop-picker? Please consider supporting our collective:
👉 https://opencollective.com/react-native-image-crop-picker/donate

I carefully followed cocoapods installation and tried to reinstall it.

All 10 comments

I have this issue too. I installed manually but it is not fixed. Is there any fix?
screen shot 2018-06-06 at 23 37 39
screen shot 2018-06-06 at 23 37 27
screen shot 2018-06-06 at 23 37 11

I recently started running into the issue after having it work successfully for a while after installing XCode 9.4. Not sure if its related to this problem.

@reedyrm I have 9.3 version. Did you fix the problem?

It turns out that the libraries were not being compiled with my project. So I solved this problem by removing all references of react-native-image-crop-picker, QBImagePicker, and RSKImageCropper. Then, I reinstalled the library using the directions in the readme and got everything working.

@reedyrm Did you install manually or with cocoapods?

Initially, I installed it with cocoapods. Then a few weeks later, switched over to manual process because I was running into CI/CD issues. Recently, I moved back to cocoapods, so I think part of my problem was left over references.

But, when I re-installed everything, I went with cocoapods and its working for dev and prod builds now.

@reedyrm Well I tried both but I still get the error. Could you send your podfile?

I've scrubbed out the other pods that I'm using, but here is my podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '8.0'

target '<myappname>' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for <myappname>
  rn_path = '../node_modules/react-native'
  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
  pod 'React', path: rn_path, subspecs: [
    'Core',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket'
  ]

  pod 'RNImageCropPicker', :path =>  '../node_modules/react-native-image-crop-picker'



  target '<myappnameTests>' do
    inherit! :search_paths
    # Pods for testing
  end

end

target '<myappname>-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for <myappname>-tvOS

  target '<myappname>-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "React"
          target.remove_from_project
        end
        target.build_configurations.each do |config|
            config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
        end
    end
end

Can someone explain me this step, shall i drop ios/imagecroppickersdk to xcode project or directly drop it into the finder. If i drop it into xcode then what will be its location?root of the project? or any other folder

Post-install steps
iOS
Step 2

Drag and drop the ios/ImageCropPickerSDK folder to your xcode project. (Make sure Copy items if needed IS ticked)

@ilysorc
for iOS
check this path: project->General->Linked Frameworks and Libraries
make sure you can find
otherwise, click '+', and add this package

it works for me

Was this page helpful?
0 / 5 - 0 ratings