ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.16k stars 1.56k forks source link

ImagePicker is undefined (using custom xxconfig) #722

Open macrozone opened 6 years ago

macrozone commented 6 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is 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.

ilysorc commented 6 years ago

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
reedyrm commented 6 years ago

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.

ilysorc commented 6 years ago

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

reedyrm commented 6 years ago

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.

ilysorc commented 6 years ago

@reedyrm Did you install manually or with cocoapods?

reedyrm commented 6 years ago

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.

ilysorc commented 6 years ago

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

reedyrm commented 6 years ago

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
noumanDev commented 6 years ago

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)

yongqianvip commented 6 years ago

@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