1

I'm using xcode 10 and getting the following error when I try to build:

Undefined symbols for architecture x86_64: "YGConfig::YGConfig(int ()(YGConfig, YGNode*, YGLogLevel, char const*, __va_list_tag*))", referenced from: _YGConfigNew in libyoga.a(Yoga.o) 

My podfile looks like:

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

# Pods for CrisisApp

pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge'
]

pod 'Interactable', :path => '../node_modules/react-native-interactable'

pod 'Folly', :podspec => '../node_modules/react-native/third-party- 
podspecs/Folly.podspec'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'

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

pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'

pod 'lottie-ios', :path => '../node_modules/lottie-ios'

pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'


target 'CrisisApp-tvOSTests' do
inherit! :search_paths
# Pods for testing
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'

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

pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'

pod 'lottie-ios', :path => '../node_modules/lottie-ios'

pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

end

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

end

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

# Pods for CrisisApp-tvOS

end

I've seen two other similar questions like this on SO, but no response so far so please help

Links to other questions: Undefined symbols for architecture x86_64 : referenced from: _YGConfigNew in libyoga.a(Yoga.o)

React Native iOS build failing for the following error: symbol(s) not found for architecture arm64

2 Answers2

1

I think there are 2 solutions:

1) you can remove all those pods and add the dependencies inside the project target Linked frameworks and libraries like this:

enter image description here

After you add them there you remove these lines from the pod file:

pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'

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

pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'

pod 'lottie-ios', :path => '../node_modules/lottie-ios'

pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

If you get more crashes related to other RN or React libs make sure they are in Linked frameworks and libraries.

2) If you have RN version>0.60 you can try to use autolinking, remove those dependencies from Xcode linked frameworks and libraries (check also the big ios project file), keep the deps only in pod file and run a pod install.

You could try this autolinking step by step for each library, it might not work for some old ones. Also check that your versions of libraries support autolinking.

Florin Dobre
  • 9,872
  • 3
  • 59
  • 93
0

I think you need to remove the entire Libraries group, with React.xcodeproj, etc. Once you start pulling in the React pod with a Podfile, those cause linking issues.

Jimmy Dee
  • 1,070
  • 1
  • 11
  • 17