iOS版编译编译为设备库/框架连接标志问题,但没有模拟器 [英] iOS compile library/framework linker flags issues compiling for device but not simulator

查看:165
本文介绍了iOS版编译编译为设备库/框架连接标志问题,但没有模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用PhoneGap的用的CocoaPods。 PhoneGap的已经所以我只是用X code。与生成的项目文件(assumably我不得不这样做,反正用的CocoaPods时),在命令行编译的问题。

I'm trying to use a Phonegap with cocoapods. Phonegap already has issues compiling from command line so I'm just using Xcode with the generated project file (and assumably I'd have to do that anyway when using cocoapods).

我已经推高了Github上与我的问题再现空项目:
<一href=\"https://github.com/Dan2552/phonegap-reproducable-issue\">https://github.com/Dan2552/phonegap-reproducable-issue

I've pushed up on Github a reproduced empty project with my problem: https://github.com/Dan2552/phonegap-reproducable-issue

您可以看到我做的 build_ios 脚本平原全新的PhoneGap应用在回购的根目录后作出的步骤。但我也推高了生成的项目文件(平台/ IOS)所以任何人都没有的PhoneGap应该能够打开该项目。

You can see the steps I made after making a plain brand-new Phonegap app in the build_ios script in the root directory on the repo. But I've also pushed up the generated project files (platforms/ios) so anybody without Phonegap should be able to open the project.

我在与编译一个奇怪的问题。与pre-捆绑科尔多瓦图书馆的CocoaPods可能发布。

I'm having a weird issue with compiling. Probably issues with the pre-bundled Cordova library and cocoapods.

在不产生与PhoneGap的项目,并在加的CocoaPods后做什么建筑,我得到了以下错误:

When building without doing anything after generating the project with Phonegap and adding in the cocoapods, I get the following errors:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_OTPublisher", referenced from:
  objc-class-ref in libPods.a(OpenTokPlugin.o)
"_OBJC_CLASS_$_OTSession", referenced from:
  objc-class-ref in libPods.a(OpenTokPlugin.o)
"_OBJC_CLASS_$_OTSubscriber", referenced from:
  objc-class-ref in libPods.a(OpenTokPlugin.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

的CocoaPods警告:

Cocoapods warns:

[!]目标的HelloWorld [调试] 覆盖 OTHER_LDFLAGS 建立`豆荚/豆荚设置中定义。 xcconfig。

[!] The target HelloWorld [Debug] overrides the OTHER_LDFLAGS build setting defined in `Pods/Pods.xcconfig'.

目标的HelloWorld [!] [调试 - 发行] 覆盖 OTHER_LDFLAGS 在`豆荚构建设置中定义/ Pods.xcconfig。

[!] The target HelloWorld [Debug - Release] overrides the OTHER_LDFLAGS build setting defined in `Pods/Pods.xcconfig'.

,所以我想干脆删除 OTHER_LDFLAGS ('其它链接器标记在X code)项。 此编译成功的iOS设备上,而不是在模拟器上,也将在项目建设上的档案。

and therefore I tried deleting the OTHER_LDFLAGS ('Other Linker Flags' in Xcode) entry altogether. This successfully compiles on an iOS device, but not on the simulator, nor will the project build on archive.

建筑为模拟器将得到同样的错误之前(的架构未定义的符号

Building for simulator will get the same error as before (Undefined symbols for architecture)

建筑归档将得到
/Users/dan2552/projects/ReproducableProblems/OpenTokPhonegap/Classes/OpentokPlugin.h:9:9:'科尔多瓦/ CDVPlugin.h找不到文件

我也试图把 $(继承) OTHER_LDFLAGS 产生相同的结果删除它们

I've also tried putting $(inherited) in the OTHER_LDFLAGS which produces the same results as deleting them.

推荐答案

您包括框架有没有模拟器(I386)切片:

Your included framework has no Simulator (i386) slice:

$ xcrun -sdk iphoneos lipo -info Pods/OpenTokSDK-WebRTC/Opentok.framework/Versions/A/Opentok 
Architectures in the fat file: Pods/OpenTokSDK-WebRTC/Opentok.framework/Versions/A/Opentok are: armv7 armv7s

所以它的类不能被链接的模拟器。

So its classes can't be linked for the Simulator.

此外,如果你打算使用的CocoaPods你可以删除科尔多瓦项目和静态库完全并添加荚'科尔多瓦您Podfile。

Also if you plan to use CocoaPods you could remove the Cordova project and static library entirely and add pod 'Cordova' to your Podfile.

这篇关于iOS版编译编译为设备库/框架连接标志问题,但没有模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆