Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 将OpenTok框架添加到我的项目中_Ios_Objective C_Xcode_Frameworks_Opentok - Fatal编程技术网

Ios 将OpenTok框架添加到我的项目中

Ios 将OpenTok框架添加到我的项目中,ios,objective-c,xcode,frameworks,opentok,Ios,Objective C,Xcode,Frameworks,Opentok,因此,我试图将OpenTok框架添加到我的代码中。我从下载IOS SDK,然后将opentok.framwork文件拖到我的框架列表中。当我构建代码时,代码失败,出现以下错误: Ld /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/Societe

因此,我试图将OpenTok框架添加到我的代码中。我从下载IOS SDK,然后将opentok.framwork文件拖到我的框架列表中。当我构建代码时,代码失败,出现以下错误:

Ld /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral normal arm64
cd /Users/hussein/Projects/ios-client
export IPHONEOS_DEPLOYMENT_TARGET=5.1.1
export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos -L/opt/vagrant/embedded/lib -F/Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/hussein/Projects/ios-client -filelist /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral.LinkFileList -miphoneos-version-min=5.1.1 -dead_strip -force_load -ObjC -mthumb -fobjc-arc -lsqlite3.0 -fobjc-arc -fobjc-link-runtime -framework GLKit -framework VideoToolbox -framework OpenTok -liconv -lstdc++.6.0.9 -lsqlite3 -framework LocalAuthentication /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Products/Debug-iphoneos/libCorePlot-CocoaTouch.a -framework MobileCoreServices -framework CoreText -weak_framework AdSupport -framework CoreAudio -weak_framework Social -framework QuartzCore -framework CoreGraphics -weak_framework Accounts -framework AddressBook -framework AddressBookUI -framework AudioToolbox -framework CFNetwork -framework CoreVideo -framework ImageIO -framework Foundation -framework MessageUI -framework OpenGLES -framework Twitter -framework AVFoundation -framework CoreMedia -framework CoreData -framework CoreFoundation -framework MapKit -framework CoreLocation -framework CoreTelephony -framework Security -framework SystemConfiguration -framework UIKit -Xlinker -dependency_info -Xlinker /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral_dependency_info.dat -o /Users/hussein/Library/Developer/Xcode/DerivedData/SocieteGeneral-hiagtpmptjkrqjbabjxpjmnshezi/Build/Intermediates/SocieteGeneral.build/Debug-iphoneos/SocieteGeneral.build/Objects-normal/arm64/SocieteGeneral

ld: file not found: -ObjC
clang: error: linker command failed with exit code 1 (use -v to see invocation)

好的,问题有点复杂: 当你在项目中拖拽你的库时,你弄乱了链接器的标志(你可以在构建阶段->其他链接器标志中看到它们),现在当cocoaPods成功添加OpenTok时(我尝试了,没有错误),它仍然有标志(有错误)。 现在最复杂的部分是:很难知道哪些标志会导致问题

(即使删除-Objc标志,问题也可能来自其他标志,因为: 你继承了一些遗产, 您的项目可能需要此标志, 修改它们可能会产生其他错误 等等) ,并且不能在xCode中“重置”您的标志

所以最好的解决方案是:创建一个新项目,添加cocoapods OpenTok

platform :ios, '8.0'
use_frameworks!

target 'app' do
pod 'OpenTok', '~> 2.6'
end

target 'appTests' do
pod 'OpenTok', '~> 2.6'
end

target 'appUITests' do
pod 'OpenTok', '~> 2.6'
end
以及我的补充:

#import "OpenTok/OpenTok.h"

要查看使用默认设置和cocoapod的新项目中是否仍然存在错误,如果不在新项目中拖动预先保存的项目文件,请尝试在生成设置中添加其他LinkerFlags


试试这个!并检查部署目标是否为iOS 8.0或更高版本。

由于启用位码,可能会出现此错误。 尝试将启用位代码设置为“否”

转到目标->构建设置->搜索“启用位码”->设置为“否”

这就解决了我的问题


你能用cocoaPods吗?我试过用cocoaPods安装它,但还是遇到同样的错误!谢谢你的回答,但我认为你的建议不可行。我试图添加的项目也是一个有多个目标的大型项目。我不能简单地在新项目中拖动我的文件!在添加OpenTok框架之前是否保存了项目?