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

0.59.8 run-ios fails to link React Pods #626

Closed
Ashoat opened this issue Aug 7, 2019 · 2 comments
Closed

0.59.8 run-ios fails to link React Pods #626

Ashoat opened this issue Aug 7, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@Ashoat
Copy link
Contributor

Ashoat commented Aug 7, 2019

Environment

React Native Environment Info:
  System:
    OS: macOS 10.14.6
    CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 4.64 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/opt/node@10/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      Build Tools: 26.0.3, 27.0.3, 28.0.3
      API Levels: 23, 25, 26, 27, 28
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.3 => 16.8.3
    react-native: 0.59.8 => 0.59.8
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7
    react-native-log-ios: 1.0.1

Description

I have a CocoaPods setup using React Native 0.59.8. I encountered an issue building an archive last week that had to do with duplicate build artifacts. To address it, I followed @Salakar's advice and removed all the references to React from my xcodeproj, leaving it to CocoaPods to build React.

image

I am now able to build successfully from Xcode, including debug and release, to a simulator, a real device, or an archive. However, react-native run-ios fails during the linking step:

info Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTLinkingManager", referenced from:
      objc-class-ref in AppDelegate.o

info   "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from:

info       objc-class-ref in libReact.a(RCTPackagerConnection.o)

info   "_OBJC_CLASS_$_RCTSRWebSocket", referenced from:

info       objc-class-ref in libReact.a(RCTInspectorPackagerConnection.o)

info ld: symbol(s) not found for architecture x86_64

info clang: error: linker command failed with exit code 1 (use -v to see invocation)

My Podfile follows:

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

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

  # Pods for SquadCal
  pod 'React', :path => '../../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket',
    'RCTAnimation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTCameraRoll',
    'RCTBlob',
    'ART',
  ]

  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'

  pod 'RNScreens', :path => '../../node_modules/react-native-screens'
  pod 'RNGestureHandler', :path => '../../node_modules/react-native-gesture-handler'
  pod 'react-native-onepassword', :path => '../../node_modules/react-native-onepassword'
  pod 'RNVectorIcons', :path => '../../node_modules/react-native-vector-icons'
  pod 'react-native-splash-screen', :path => '../../node_modules/react-native-splash-screen'
  pod 'RNKeychain', :path => '../../node_modules/react-native-keychain'
  pod 'react-native-fast-image', :path => '../../node_modules/react-native-fast-image'
  pod 'react-native-orientation-locker', :path => '../../node_modules/react-native-orientation-locker'
  pod 'RNReanimated', :path => '../../node_modules/react-native-reanimated'
  pod 'react-native-async-storage', :path => '../../node_modules/@react-native-community/async-storage'
  pod 'react-native-netinfo', :path => '../../node_modules/@react-native-community/netinfo'
  pod 'react-native-notifications', :path => '../../node_modules/react-native-notifications'
  pod 'react-native-exit-app', :path => '../../node_modules/react-native-exit-app'
  pod 'react-native-keyboard-tracking-view', :path => '../../node_modules/react-native-keyboard-tracking-view'
  pod 'react-native-keyboard-input', :path => '../../node_modules/react-native-keyboard-input'
  pod 'react-native-cameraroll', :path => '../../node_modules/@react-native-community/cameraroll'
  pod 'lottie-react-native', :path => '../../node_modules/lottie-react-native'
  pod 'react-native-image-resizer', :path => '../../node_modules/react-native-image-resizer'
  pod 'RNFS', :path => '../../node_modules/react-native-fs'

end

Reproducible Demo

I don't have an MCVE at the moment. I'll try to do some more debugging first to see if I can get the linker to work. I'll document my work here. If I fail to come up with anything and you folks don't have any quick thoughts on how to resolve it, I can try and create a MCVE so you guys can repro.

@Ashoat Ashoat added the bug Something isn't working label Aug 7, 2019
@Ashoat
Copy link
Contributor Author

Ashoat commented Aug 7, 2019

This issue was resolved by clearing DerivedData.

The reason it was working from Xcode was that Xcode stores DerivedData in ~/Library/Developer/Xcode/DerivedData, whereas react-native run-ios uses a custom path in ios/build. Simply removing that folder and rerunning react-native run-ios resolved my issue.

@Ashoat Ashoat closed this as completed Aug 7, 2019
@philjoseph
Copy link

@Ashoat You just explained why it was working on Xcode but you did not explained why it was not working from the command line. Can you please clarify how you succeed to link from the command line since I do have the exact same problem and do not yet figure out what is the solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants