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

xCode fails to build new react-native init project due to 'library not found for -lDoubleConversion' #25546

Closed
shannonjensen opened this issue Jul 8, 2019 · 18 comments
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@shannonjensen
Copy link

I have initiated a new react-native app with the react-native cli (react-native init newproject). The build works if I then run react-native run-ios but if I open the project in xcode (via the .xcodeproj file in the ios folder) then the build fails due to 'library not found for -lDoubleConversion'

image

React Native version:
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 28.45 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.5.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-log-ios: 1.0.1

Steps To Reproduce

  1. react-native init newproject
  2. open ios/newproject.xcodeproj in xcode and build

Describe what you expected to happen:

Build to fail with warning "library not found for -lDoubleConversion"

Snack, code example, or link to a repository:

@sw-tt-keyurprajapati
Copy link

Please try this. It's work for me in error which I am getting in installing pods.
sudo xcode-select -switch <path/to/>Xcode.app

@irshadpc
Copy link

irshadpc commented Jul 9, 2019

@shannonjensen Look like your project never run the 'pod install' command.

Do the below steps

  1. go to ios/
  2. run 'pod install' or 'pod update'
  3. open ios/newproject.xcworkspace

@shannonjensen
Copy link
Author

shannonjensen commented Jul 10, 2019

Thank you @irshadpc.

I followed those steps and am still getting the same error.

I uninstalled and reinstalled cocoapods previously. I ran pod install and then pod update in the ios directory and it looks like everything went as it should, no errors or warnings. But the xcode build still fails while react-native run-ios works fine.

@irshadpc
Copy link

@shannonjensen Can you please share the pod file.

@shannonjensen
Copy link
Author

Thank you @irshadpc

Podfile:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'demoUpgrade' do
  # Pods for demoUpgrade
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  target 'demoUpgradeTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'demoUpgrade-tvOS' do
  # Pods for demoUpgrade-tvOS

  target 'demoUpgrade-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Podfile.lock, in case of use:


platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'demoUpgrade' do
  # Pods for demoUpgrade
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  target 'demoUpgradeTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'demoUpgrade-tvOS' do
  # Pods for demoUpgrade-tvOS

  target 'demoUpgrade-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

@irshadpc
Copy link

irshadpc commented Jul 11, 2019

@shannonjensen Look like your 'podfile' and 'podfile.lock' are same. I don't know why it happens. Can you please share the code.

@Moneling
Copy link

I had this problem.
i resolve this problem is open the *.xcworkspace with xcode ,not the *.xcodepro.
try it.

@shannonjensen
Copy link
Author

Ah, sorry @irshadpc, my mistake. The podfile.lock is:

PODS:
  - boost-for-react-native (1.63.0)
  - DoubleConversion (1.1.6)
  - Folly (2018.10.22.00):
    - boost-for-react-native
    - DoubleConversion
    - Folly/Default (= 2018.10.22.00)
    - glog
  - Folly/Default (2018.10.22.00):
    - boost-for-react-native
    - DoubleConversion
    - glog
  - glog (0.3.5)
  - React (0.60.0):
    - React-Core (= 0.60.0)
    - React-DevSupport (= 0.60.0)
    - React-RCTActionSheet (= 0.60.0)
    - React-RCTAnimation (= 0.60.0)
    - React-RCTBlob (= 0.60.0)
    - React-RCTImage (= 0.60.0)
    - React-RCTLinking (= 0.60.0)
    - React-RCTNetwork (= 0.60.0)
    - React-RCTSettings (= 0.60.0)
    - React-RCTText (= 0.60.0)
    - React-RCTVibration (= 0.60.0)
    - React-RCTWebSocket (= 0.60.0)
  - React-Core (0.60.0):
    - Folly (= 2018.10.22.00)
    - React-cxxreact (= 0.60.0)
    - React-jsiexecutor (= 0.60.0)
    - yoga (= 0.60.0.React)
  - React-cxxreact (0.60.0):
    - boost-for-react-native (= 1.63.0)
    - DoubleConversion
    - Folly (= 2018.10.22.00)
    - glog
    - React-jsinspector (= 0.60.0)
  - React-DevSupport (0.60.0):
    - React-Core (= 0.60.0)
    - React-RCTWebSocket (= 0.60.0)
  - React-fishhook (0.60.0)
  - React-jsi (0.60.0):
    - boost-for-react-native (= 1.63.0)
    - DoubleConversion
    - Folly (= 2018.10.22.00)
    - glog
    - React-jsi/Default (= 0.60.0)
  - React-jsi/Default (0.60.0):
    - boost-for-react-native (= 1.63.0)
    - DoubleConversion
    - Folly (= 2018.10.22.00)
    - glog
  - React-jsiexecutor (0.60.0):
    - DoubleConversion
    - Folly (= 2018.10.22.00)
    - glog
    - React-cxxreact (= 0.60.0)
    - React-jsi (= 0.60.0)
  - React-jsinspector (0.60.0)
  - React-RCTActionSheet (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTAnimation (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTBlob (0.60.0):
    - React-Core (= 0.60.0)
    - React-RCTNetwork (= 0.60.0)
    - React-RCTWebSocket (= 0.60.0)
  - React-RCTImage (0.60.0):
    - React-Core (= 0.60.0)
    - React-RCTNetwork (= 0.60.0)
  - React-RCTLinking (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTNetwork (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTSettings (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTText (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTVibration (0.60.0):
    - React-Core (= 0.60.0)
  - React-RCTWebSocket (0.60.0):
    - React-Core (= 0.60.0)
    - React-fishhook (= 0.60.0)
  - yoga (0.60.0.React)

DEPENDENCIES:
  - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
  - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
  - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
  - React (from `../node_modules/react-native/`)
  - React-Core (from `../node_modules/react-native/React`)
  - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
  - React-DevSupport (from `../node_modules/react-native/React`)
  - React-fishhook (from `../node_modules/react-native/Libraries/fishhook`)
  - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
  - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
  - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
  - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
  - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
  - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
  - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
  - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
  - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
  - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
  - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
  - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
  - React-RCTWebSocket (from `../node_modules/react-native/Libraries/WebSocket`)
  - yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
  https://github.com/cocoapods/specs.git:
    - boost-for-react-native

EXTERNAL SOURCES:
  DoubleConversion:
    :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
  Folly:
    :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec"
  glog:
    :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
  React:
    :path: "../node_modules/react-native/"
  React-Core:
    :path: "../node_modules/react-native/React"
  React-cxxreact:
    :path: "../node_modules/react-native/ReactCommon/cxxreact"
  React-DevSupport:
    :path: "../node_modules/react-native/React"
  React-fishhook:
    :path: "../node_modules/react-native/Libraries/fishhook"
  React-jsi:
    :path: "../node_modules/react-native/ReactCommon/jsi"
  React-jsiexecutor:
    :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
  React-jsinspector:
    :path: "../node_modules/react-native/ReactCommon/jsinspector"
  React-RCTActionSheet:
    :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
  React-RCTAnimation:
    :path: "../node_modules/react-native/Libraries/NativeAnimation"
  React-RCTBlob:
    :path: "../node_modules/react-native/Libraries/Blob"
  React-RCTImage:
    :path: "../node_modules/react-native/Libraries/Image"
  React-RCTLinking:
    :path: "../node_modules/react-native/Libraries/LinkingIOS"
  React-RCTNetwork:
    :path: "../node_modules/react-native/Libraries/Network"
  React-RCTSettings:
    :path: "../node_modules/react-native/Libraries/Settings"
  React-RCTText:
    :path: "../node_modules/react-native/Libraries/Text"
  React-RCTVibration:
    :path: "../node_modules/react-native/Libraries/Vibration"
  React-RCTWebSocket:
    :path: "../node_modules/react-native/Libraries/WebSocket"
  yoga:
    :path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
  boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
  DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
  Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
  glog: 1f3da668190260b06b429bb211bfbee5cd790c28
  React: 4b3c068e793e96672dcd186a2b572fac43e4b031
  React-Core: 3dc86b22920597f813c62a96db3165950b64826b
  React-cxxreact: 0dacb291e59b81e7c3f22a2118bee853ba8a60d2
  React-DevSupport: 4eb4135386acd10c2586cc9c759bf96b4dac035e
  React-fishhook: 86ca737527bb9d860efbb943c11c729a5b69aa3d
  React-jsi: 8e128c4d0d8febc2977ef617d1c09bb54326069c
  React-jsiexecutor: 7a3554f703a58963ec80b860144ea0f0e9b910e1
  React-jsinspector: d4ed52225912efe0019bb7f1a225aec20f23049a
  React-RCTActionSheet: b27ff3cf3a68f917c46d2b94abf938b625b96570
  React-RCTAnimation: 9e4708e5bd65fca8285ce7c0aa076f3f4fa5c2f8
  React-RCTBlob: 6eafcc3a24f33785692a7be24918ade607bc8719
  React-RCTImage: 46b965d7225b428ea11580ead08a4318aef1d6be
  React-RCTLinking: d65b9f56cf0b8e171575a86764df7bb019ac28d6
  React-RCTNetwork: 783ee2f430740e58f724e46adc79fe7feff64202
  React-RCTSettings: aa28315aadfbfaf94206d865673ae509f1e97c07
  React-RCTText: 685fca2e13b024271048e7e247ef24476f28a41e
  React-RCTVibration: 4ee1cf208ab17a50fafb1c16ffe28fe594a64e4f
  React-RCTWebSocket: fca087d583724aa0e5fef7d911f0f2a28d0f2736
  yoga: 616fde658be980aa60a2158835170f3f9c2d04b4

PODFILE CHECKSUM: dca13e28f5c4ca875863a7288a10696a04a1c0c2

COCOAPODS: 1.7.4

@irshadpc
Copy link

@shannonjensen Please update your cocoapods and run the pod update command. Let me see what happens.

@xJkit
Copy link

xJkit commented Jul 29, 2019

Due to the fact that DoubleConversion is a third-party library, I think you should open your project with .xcworkspace rather than .xcodeproj.

@CompSciGuy777
Copy link

CompSciGuy777 commented Aug 17, 2019

I am having the same problem, only when I try and build the tvOS build of my app in Xcode. I can build the mobile version through the CLI and through Xcode but as soon as I try and target the tv-OS simulator. Things I noticed as I was looking through the project/ios files:

  • the tvOS sub-folder didn't have a copy of the project files(appDelegate.m, etc.)...fixed...still the same error

Screen Shot 2019-08-17 at 8 49 17 AM

  • Other linking under build settings for tvOS project in Xcode...fixed by copying the iOS portion of the podfile to the tvOS portion

Screen Shot 2019-08-17 at 8 48 20 AM

  • I have tried pod install and pod update at various times
  • I have tried deleting my derived data folder

Does anyone know how to get the tvOS to build? Any other Debugging ideas? I can get it to run for iOS but don't know enough about react-native or iOS development to effectively change the device target without some help.

PS: I did open the .workspace, I did try the .proj but got different errors.

@YBDevelopment
Copy link

I have the same problem when I try simulate on tv-ios
with this error
ld: library not found for -lPods-reactProject-tvOS

then I found this post when I create the project from his code it works
https://github.com/danilvalov/react-native-appletv
the app runs on tv-os perfect!

@danilvalov thanks

@Fr1kki3
Copy link

Fr1kki3 commented Aug 21, 2019

Temp fix:

right click on products,
select add files,
navigate to ../node_modules/react-native/,
add react project file,
edit scheme,
navigate to build tab,
remove React (missing),
add libReact.a,
move React to top of build order

@sourish
Copy link

sourish commented Sep 18, 2019

@shannonjensen Look like your project never run the 'pod install' command.

Do the below steps

  1. go to ios/
  2. run 'pod install' or 'pod update'
  3. open ios/newproject.xcworkspace

This fixed my problem, Thank U.
Can I know from when did pods became mandatory ?

@irshadpc
Copy link

@shannonjensen, any update on this.

@pabloluz
Copy link

For any of you guys who can be still running into this issue, try to follow @xJkit 's solution above. Also, don't forget to run pod install in /ios dir.

It worked for me! As an additional tip, try to clean Xcode's cache and/or delete .../Xcode/DerivedData contents manually.

I'm on Xcode version 11.1 (11A1027).

@stale
Copy link

stale bot commented Jan 21, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 21, 2020
@stale
Copy link

stale bot commented Jan 28, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 28, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

10 participants