React Native iOS:重复符号,即`重复符号_OBJC_METACLASS _ $ _ RCTWebSocketModule`

时间:2018-01-12 21:44:54

标签: react-native react-native-ios

所以,由于未知原因我有多少重复的符号。

示例

duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
    /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/ArchiveIntermediates/clustr/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
    /Users/michaelstokes/Library/Developer/Xcode/DerivedData/Clustr-fkpfvfogtttxepgdsdrkmamfpvax/Build/Intermediates.noindex/ArchiveIntermediates/clustr/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
ld: 284 duplicate symbols for architecture arm64

enter image description here

我有点困惑,为什么虽然这里是我的图书馆清单

enter image description here

我的Podfile目前是这样的,因为我调查了重复符号背后的原因

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

target 'clustr' do

#    # Flexbox Layout Manager Used By React Natve
   pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
#
#    # React Native
    pod 'React', path: '../node_modules/react-native', subspecs: [
#    # Comment out any unneeded subspecs to reduce bundle size.
    'Core',
#    'DevSupport',
#    'RCTActionSheet',
#    'RCTAnimation',
#    'RCTBlob',
#    'RCTCameraRoll',
##    'RCTGeolocation',
##    'RCTImage',
##    'RCTNetwork',
#    'RCTPushNotification',
##    'RCTSettings',
#    'RCTTest',
##    'RCTText',
##    'RCTVibration',
##    'RCTWebSocket',
##    'RCTLinkingIOS'
    ]

    # OneSignal
    # pod 'OneSignal', '~> 1.13.3'

    # Mapbox
    pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'

    pod 'Stripe', '~> 10.1.0'

    inherit! :search_paths
end

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

target 'clustr' do

#    # Flexbox Layout Manager Used By React Natve
   pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
#
#    # React Native
    pod 'React', path: '../node_modules/react-native', subspecs: [
#    # Comment out any unneeded subspecs to reduce bundle size.
    'Core',
#    'DevSupport',
#    'RCTActionSheet',
#    'RCTAnimation',
#    'RCTBlob',
#    'RCTCameraRoll',
##    'RCTGeolocation',
##    'RCTImage',
##    'RCTNetwork',
#    'RCTPushNotification',
##    'RCTSettings',
#    'RCTTest',
##    'RCTText',
##    'RCTVibration',
##    'RCTWebSocket',
##    'RCTLinkingIOS'
    ]

    # OneSignal
    # pod 'OneSignal', '~> 1.13.3'

    # Mapbox
    pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'

    pod 'Stripe', '~> 10.1.0'

    inherit! :search_paths
end

1 个答案:

答案 0 :(得分:0)

当我收到此错误时,从Pods目标中删除React可解决此问题。

这是由于CocoaPods添加React和通常如何在链接时将React添加到库部分之间的冲突引起的。