CocoaPods use_frameworks!阻止XCode链接库

时间:2016-01-20 20:00:30

标签: ios objective-c xcode cocoapods

由于我已经开始(尝试)use_frameworks!我的本地开发窗格无法访问我项目顶层所包含的代码。这曾经有用,如果我在下面的死简单Podfile中注释掉use_frameworks,它仍然有效:

platform :ios, '9.0'
use_frameworks! #comment this out and all is well

target :test_use_frameworks do
  pod 'STHTTPRequest', '1.0.0' #test a well known library
  pod 'test_pod', :path => '../test_pod/' #Attempt to use that library from within local pod
end

我已经制作了一个简单的 objective-c only 测试项目,可以访问here

当我尝试在我的本地test_pod中使用STHTTPRequest时,如下所示:

STHTTPRequest * r = [STHTTPRequest requestWithURLString:@"http://www.google.com"];

我收到以下错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_STHTTPRequest", referenced from:
      objc-class-ref in TestClass.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(无论我尝试使用什么课程,都会发生这种情况 - 问题与STHTTPRequest无关...)

本地podspec也很简单:

Pod::Spec.new do |s|
  s.name             = "test_pod"
  s.version          = "0.1.0"
  s.summary          = "A short description of test_pod."
  s.description      = "use_frameworks! is causing problems for me"
  s.homepage         = "https://github.com/<GITHUB_USERNAME>/test_pod"
  s.license          = 'MIT'
  s.source           = { :git => "https://github.com/<GITHUB_USERNAME>/test_pod.git", :tag => s.version.to_s }
  s.platform     = :ios, '7.0'
  s.requires_arc = true
  s.source_files = 'Pod/Classes/**/*'
  s.resource_bundles = {
    'test_pod' => ['Pod/Assets/*.png']
  }
  s.dependency 'AFNetworking', '~> 2.3'
end

以下是我在此主题中发现的SO问题: 1 2 3,但没有一个有帮助。我已经尝试了我能想到的标题搜索路径,用户标题搜索路径框架搜索路径的每个变体。

同样,这个项目没有SWIFT 。很快,如果我可以让它发挥作用,但还没有......

我正在使用cocoapods 0.39.0

我错过了什么?

编辑:有用的Cocoapods小组回答了这个问题here

1 个答案:

答案 0 :(得分:0)

有用的Cocoapods团队here

回答了这个问题