【问题标题】:Podspec failing on podfile pod importsPodspec 在 podfile pod 导入上失败
【发布时间】:2016-03-10 18:23:30
【问题描述】:

我为我的项目创建了一个podspec 文件,该文件本身有一个podfile

Podfile 看起来像这样:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'FLAnimatedImage', '~> 1.0'

Podspec 文件也是标准设置:

Pod::Spec.new do |s|
  s.name         = "ConversationVC"
  s.version      = "1.0.1"
  s.summary      = "ConversationViewController, for messaging"
  s.homepage     = "[HOMEPAGE URL]"
  s.author       = { "Andrew Hart" => "[EMAIL ADDRESS]" }
  s.license      = { :type => 'MIT', :file => 'LICENSE'  }
  s.source       = { :git => "[GIT URL]", :tag => s.version.to_s }
  s.platform     = :ios, '9.0'
  s.requires_arc = true
  s.source_files  = 'Source/**/*.swift'
  s.frameworks   = 'UIKit'
  s.ios.deployment_target = '9.0'
end

我正在使用pod lib lint 命令来确保它通过了 Podspec 测试,但我收到了这个错误:

错误 | xcodebuild: /Users/Andrew/Code/ConversationVC/Source/View/ConversationImageCell.swift:10:8: 错误:没有这样的模块'FLAnimatedImage'

该文件确实有一个 import FLAnimatedImage 行,引用我的一个 pod,就像我项目中的许多其他文件一样。

我确实尝试在另一个项目中使用 pod,提供 git url,它成功了,但是当我在 Xcode 中构建工作区时,它给了我同样的错误,与缺少 FLAnimatedImage 框架有关。

我想知道我应该如何处理这种情况?

【问题讨论】:

  • 我遇到了类似的问题。我的 Xcode 没有抛出任何错误,但 pod spec lint 总是说 error: no such module 失败。

标签: ios xcode swift cocoapods podspec


【解决方案1】:

你也应该在你的 podspec 文件中声明你的依赖,像这样:

s.dependecy "FLAnimatedImage", "~> 1.0"

【讨论】:

    猜你喜欢
    • 2015-03-30
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 2023-04-08
    • 2016-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多