0

Xcode 抛出以下链接器错误:

duplicate symbol '_kSessionVariantKey' in:
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/libCleverTap-iOS-SDK.a(CTABTestUtils.o)
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/Mixpanel/libMixpanel.a(MPABTestDesignerConnection.o)
duplicate symbol '_OBJC_IVAR_$__MPRunLoopThread._waitGroup' in:
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/libCleverTap-iOS-SDK.a(CTWebSocket.o)
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/Mixpanel/libMixpanel.a(MPWebSocket.o)
duplicate symbol '_OBJC_IVAR_$__MPRunLoopThread._runLoop' in:
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/libCleverTap-iOS-SDK.a(CTWebSocket.o)
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/Mixpanel/libMixpanel.a(MPWebSocket.o)
duplicate symbol '_OBJC_CLASS_$__MPRunLoopThread' in:
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/libCleverTap-iOS-SDK.a(CTWebSocket.o)
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/Mixpanel/libMixpanel.a(MPWebSocket.o)
duplicate symbol '_OBJC_METACLASS_$__MPRunLoopThread' in:
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/CleverTap-iOS-SDK/libCleverTap-iOS-SDK.a(CTWebSocket.o)
    /Users/apple/Library/Developer/Xcode/DerivedData/SmallcaseIos-fntvhvlzlxqompcrpbimpmiwsjiq/Build/Products/Debug-iphonesimulator/Mixpanel/libMixpanel.a(MPWebSocket.o)
ld: 5 duplicate symbols for architecture x86_64

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

libCleverTap-iOS-SDK.a 和 libMixpanel.a 中似乎有重复的符号。

我在 RN-0.61 上,两个库都是自动链接的。pod 文件正在使用use_modular_headers!,因为某些依赖项需要它。

在我放入use_modular_headers!.

我似乎无法弄清楚我做错了什么。

播客文件 -

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'SmallcaseIos' do
  # react pods
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  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-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  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 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

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

  # Pods for SmallcaseIos
  use_modular_headers!
  pod 'SwiftyJSON', '3.1.4'
  pod 'Charts', '3.3.0'
  pod 'Branch', '0.27.1'

  use_native_modules!
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '5.0'
    end
  end
end
4

1 回答 1

1

这是非常简单的过程,转到文件 => 工作区设置 => 构建系统并单击它并将其选择为“旧版构建系统”并按完成,然后清除构建并再次运行它的工作。

于 2019-12-03T09:31:07.310 回答