gpt4 book ai didi

swift - 遇到未知错误(CocoaPods 找不到 pod 的兼容版本

转载 作者:行者123 更新时间:2023-11-28 14:20:54 25 4
gpt4 key购买 nike

我正在创建一个 pod。linting 时出现此错误:pod spec lint TrackerExample.podspec --no-clean --use-libraries

我距离 pod 验证有 1 个错误。您能否帮助找出缺少的内容或需要修改的内容。

这是我的podspec:

Pod::Spec.new do |spec|
spec.name = "TrackerExample"
spec.version = "0.0.1"
spec.license = "Copyright ****"
spec.homepage = "https:// *****"
spec.author = { "*****" => "*******" }
spec.summary = "some description"
spec.source = { :git => "******t" }
spec.source_files = "TrackerExample/*.{h,m}"
spec.ios.deployment_target = "9.0"
spec.osx.deployment_target = "10.10"
spec.swift_version = '4.0'
spec.dependency 'MatomoTracker', '5.2'
spec.subspec 'MatomoTracker' do |lib|
lib.dependency 'MatomoTracker', '5.2'
lib.source_files = "Pods/MatomoTracker/MatomoTracker/*.{h,m,swift}"
end
end

而且,这是终端输出。我收到以下错误:

ERROR | [OSX] unknown: Encountered an unknown error (CocoaPods could not find compatible versions for pod "MatomoTracker":




-> TrackerExample (0.0.1)
- WARN | source: Git sources should specify a tag.
- WARN | [iOS] license: Unable to find a license file
- WARN | xcodebuild: MatomoTracker/MatomoTracker/EventSerializer.swift:15:19: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
- NOTE | xcodebuild: MatomoTracker/MatomoTracker/EventSerializer.swift:15:19: note: use 'compactMap(_:)' instead
- WARN | xcodebuild: TrackerExample/Pods/MatomoTracker/MatomoTracker/EventSerializer.swift:15:19: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
- NOTE | xcodebuild: TrackerExample/Pods/MatomoTracker/MatomoTracker/EventSerializer.swift:15:19: note: use 'compactMap(_:)' instead
- ERROR | [OSX] unknown: Encountered an unknown error (CocoaPods could not find compatible versions for pod "MatomoTracker":
In Podfile:
TrackerExample (from `/Users/s.ludosky/Documents/projects/ios/libs/TrackerExample/TrackerExample.podspec`) was resolved to 0.0.1, which depends on
MatomoTracker (= 5.2)

Specs satisfying the `MatomoTracker (= 5.2)` dependency were found, but they required a higher minimum deployment target.) during validation.

Pods workspace available at `/var/folders/n8/9jmhgp1x2hxgg7_r4ryvs7tcn166k1/T/CocoaPods-Lint-20180821-86279-qyai9s-TrackerExample/App.xcworkspace` for inspection.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error and 4 warnings.

与 podfile 相关的东西。不过,我确实将 pod 版本指定为 5.2。为什么这与我自己的 pod 的版本 0.0.1 冲突?

仅供引用,这是我正在使用的“MatomoTracker”依赖项的 podfile

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

target 'TrackerExample' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for TrackerExample
pod 'MatomoTracker', '~> 5.2'
end

最佳答案

如果您在运行 pod spec lint 的同一目录中创建一个名为 .swift-version 的文件,其中包含您需要的版本(例如“4.0”)echo "4.0"> .swift-版本

它可能会解决您的问题。

也只需执行以下步骤:-

  1. pod 解体
  2. pods 安装
  3. pod 更新(如果有必要,请执行其他操作,如果您拥有所有最新的 pod,请不要使用它。)

关于swift - 遇到未知错误(CocoaPods 找不到 pod 的兼容版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51948509/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com