ios - Xcode 链接器错误和 pod 安装仅指示 4 个依赖项中的 3 个

标签 ios xcode cocoapods

在 Xcode 10.1 中,我收到有关 SwiftCharts 的链接器错误。这是在我开始运行 10.2 之后,由于 Xcode 错误需要恢复到 10.1。我关闭了 Xcode 并使用以下命令清理了 pod:

  rm -rf ~/Library/Caches/CocoaPods
  rm -rf Pods
  rm -rf ~/Library/Developer/Xcode/DerivedData/*
  pod deintegrate
  pod setup
  pod install

这导致没有 DerivedData。安装的输出如下:

pod install
Analyzing dependencies
Downloading dependencies
Installing Realm (3.14.1)
Installing RealmSwift (3.14.1)
Installing SwiftCharts (0.6.5)
Installing SwiftGraph (2.0.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 4 total pods installed.

此时,DerivedData中没有数据。

当我启动 Xcode 时,出现链接器错误:

: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/Realm'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/RealmSwift'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/SwiftCharts'
: Directory not found for option '-F/Users/Project-gwajzqdypdbykjhkkbcpqgffxwio/Build/Products/Debug-iphonesimulator/SwiftGraph'
: Linker command failed with exit code 1 (use -v to see invocation)

在编辑器中:

ld: framework not found SwiftCharts

在 DerivedData 下的 Debug-iphonesimulator 文件夹中,我没有看到警告指示应该存在的任何框架。 为什么缺少框架目录,为什么安装了 SwiftCharts 但链接器不可用?

播客文件:

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

target 'ProjectCoreData' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'SwiftCharts', '~> 0.6.3'
  pod 'SwiftGraph'
  pod 'OverlayContainer'
  pod 'RealmSwift'

  # Pods for ProjectCoreData

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

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

"Podfile" 24L, 549C

Podfile.lock:

PODS:
  - OverlayContainer (2.0.0)
  - Realm (3.14.1):
    - Realm/Headers (= 3.14.1)
  - Realm/Headers (3.14.1)
  - RealmSwift (3.14.1):
    - Realm (= 3.14.1)
  - SwiftCharts (0.6.5)
  - SwiftGraph (3.0.0)

DEPENDENCIES:
  - OverlayContainer
  - RealmSwift
  - SwiftCharts (~> 0.6.3)
  - SwiftGraph

最佳答案

我认为这是因为 SwiftCharts (0.6.5) 是为带有 Xcode 10.2 的 swift 5.0 构建的,所以它与 Xcode 10.1 不兼容,只需使用旧版本的 SwiftCharts (0.6.3 或更早版本)。

关于ios - Xcode 链接器错误和 pod 安装仅指示 4 个依赖项中的 3 个,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55789058/

相关文章:

ios - 如何从完成处理程序 iOS Swift 3 获取值

ios - Swift 3 Realm 在 IOS 10 模拟器上崩溃

ios - 如何计算 MapKit 中 MKRouteStep 的方向

ios - Xcode 7.2如何使用Storyboard布局比屏幕高的屏幕内容?

cocoapods - 'pod spec lint' 和 'pod lib lint' 有什么区别?

ios - react-native-twilio-video-webrtc ios pods 错误

iOS UITextInput 控件 : Receiving forward-delete key from hardware keyboard

ios - HTTP.Body 参数问题 - Swift

ios - __NSCFConstantString objectAtIndex :]: unrecognized selector sent to instance

swift - “pod spec lint”在项目转换为 Swift 4 后失败