首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CocoaPods use_frameworks!防止XCode链接库

CocoaPods use_frameworks!防止XCode链接库
EN

Stack Overflow用户
提问于 2016-01-20 20:00:30
回答 1查看 1.2K关注 0票数 2

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

代码语言:javascript
复制
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

我制定了一个简单的目标--c--纯测试项目,它是可访问的这里

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

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

我得到以下错误:

代码语言:javascript
复制
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也尽可能简单:

代码语言:javascript
复制
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

下面是我在这个主题上发现的一些问题:1 2 3.,但这些问题都没有帮助。我尝试过头搜索路径、用户头搜索路径和框架搜索路径的每个变体。

同样,这个项目中没有SWIFT。很快就会的,如果我能让它起作用的话,但还没有.

我在用cocoapods 0.39.0

我遗漏了什么?

编辑:这个问题由有帮助的Cocoapods团队这里回答

EN

回答 1

Stack Overflow用户

发布于 2016-01-22 17:02:58

这个问题得到了Cocoapods团队这里的回答。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34909389

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档