React-native-image-crop-picker: Getting build errors

Created on 5 Mar 2018  路  27Comments  路  Source: ivpusic/react-native-image-crop-picker

Getting nothing but issues, I followed the installation guide but I keep getting different
screen shot 2018-03-05 at 12 19 46 pm
errors

Most helpful comment

This is a nightmare, I'm starting to think it was a really bad idea to trust in react-native, I've been the whole day with this but there's always a nightmare with libraries. :( by the time i fought with library issues in react native I think I could have done 50 apps in android and iPhone.

All 27 comments

I just released a new version with updated installation instructions. If you follow step by step instructions from there, it will compile and run properly. https://github.com/ivpusic/react-native-image-crop-picker/releases/tag/v0.20.0

I did this but now I'm getting Lexical or Preprocessor issues
#import <React/RCTDefines.h> 'React/RCTDefines.h' file not found

Happing at #import "ImageCropPicker.h" will open a new issue

screen shot 2018-03-06 at 11 52 22 am

https://github.com/ivpusic/react-native-image-crop-picker/issues/635

can you show me you Pods file?

This is my entire pod file

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

target 'ConstructionCloud' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ConstructionCloud
  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'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

the only difference is that I don't have use_frameworks! in my Pods file. I followed instructions from readme step-by-step and it compiled and runs without problems.

Let me try without frameworks

Now I'm getting

ld: 24 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is the full error

duplicate symbol _OBJC_IVAR_$_ImageResult._data in:
    /Users/Almog/Library/Developer/Xcode/DerivedData/ConstructionCloud-bcoecdtxeoikdpcgmgahscvuemda/Build/Products/Debug-iphonesimulator/RNImageCropPicker/libRNImageCropPicker.a(ImageCropPicker.o)
    /Users/Almog/Library/Developer/Xcode/DerivedData/ConstructionCloud-bcoecdtxeoikdpcgmgahscvuemda/Build/Products/Debug-iphonesimulator/libimageCropPicker.a(ImageCropPicker.o)
ld: 24 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

maybe you linked it. Linking is only necessary if not using cocoapods. Try to unlink it.

Well I did run react-native link which I would have to do at some point for other packages so it shouldn't link this package. I did try to unlink it and I get the following error

~/Full-Time-Employment/Construction-Cloud/RnD/CCMobileApp(branch:w3.2.7*) 禄 react-native unlink react-native-image-crop-picker Almog@Almogs-MacBook-Pro
Scanning folders for symlinks in /Users/Almog/Full-Time-Employment/Construction-Cloud/RnD/CCMobileApp/node_modules (8ms)
rnpm-install info Unlinking react-native-image-crop-picker ios dependency
rnpm-install ERR! It seems something went wrong while unlinking. Error: Cannot read property 'podfile' of undefined

Cannot read property 'podfile' of undefined

react-native link without providing package name is not a good idea these days because many of third party modules are not playing well with react-native link, so I suggest to always link specific package. Cannot read property 'podfile' of undefined is something I see for the first time :/. Would be great if you can do some investigation what could be wrong here.

I'm not really seeing anything else that would hit at whats wrong, are you testing on the latest react version v0.54.0?

@ivpusic was to fix the Cannot read property 'podfile' of undefined I deleted the pod file then run the unlink command on the package added back the pod file and did pod install

But still getting
ld: 24 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

so it was not the linking

yes, I am using rn 0.54.0. Maybe open the project in Xcode, and check if react-native-image-crop-picker is still in Libraries folder. If yes, remove it. Also, check if libRNImageCropPicker is in Build Phases > Link binary with images, if yes, remove it.

Thanks working now

Sorry to reopen but if the "link" is necessary for the Android build, what should we do?

@hoscarcito Just remove pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker' from Podfile and run pod install if you are going to use link command.

What if I need to use use_frameworks! Because of another pods?
I'm making a bridge for another SDK in Swift so I need to add use_frameworks

I have the same problem but upgrading to v0.20.1 and it works. I use with CocoaPods.

This is a nightmare, I'm starting to think it was a really bad idea to trust in react-native, I've been the whole day with this but there's always a nightmare with libraries. :( by the time i fought with library issues in react native I think I could have done 50 apps in android and iPhone.

how to resolve it, I can't add any framework.

@ivpusic

can you help me? how to resolve #import <React/RCTDefines.h> 'React/RCTDefines.h' file not found, even though I only added one line:

use_frameworks!

Hey @ivpusic,

Any news on the issue ? Did you resolved it ?

Thanks!

+1 Any updates about using this package with use_frameworks!, @ivpusic? This is basically the only cross-platform RN image picker package since react-native-image-picker is no longer maintained.

Is it possible to install the package manually for ios?

@hahtml Apparently so, but the instructions are unclear ("Drag and drop the ios/ImageCropPickerSDK folder to your xcode project" -- but to which folder in the Xcode project?) and extra steps need to be followed before releasing a production build.

It's a shame as it looks like a lot of effort has been put into this package.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

co-de picture co-de  路  3Comments

Martian2Lee picture Martian2Lee  路  3Comments

pavsidhu picture pavsidhu  路  3Comments

victorwpbastos picture victorwpbastos  路  3Comments

equesteo picture equesteo  路  3Comments