2014-10-01 39 views
2

我需要將OpenTok 2.3添加到使用cocoapods的項目中,但只有2.1.7存在於pod存儲庫或github上,因此我已經在本地下載了該框架。我的文件夾結構看起來是這樣的:嘗試將OpenTok 2.3作爲本地cocoapod添加

project- 
     | 
     Podfile 
     project.xcodeproj 
     frameworks/ 
       | 
       OpenTokSDK-WebRTC.podspec 
       OpenTok-iOS-2.3.0/ 
            | 
            OpenTok.framework 

而且OpenTokSDK-WebRTC.podspec文件的內容是:

Pod::Spec.new do |s| 
s.name = 'OpenTokSDK-WebRTC' 
s.version = '2.3' 
s.authors = 'TokBox' 
s.summary = 'The OpenTok iOS SDK lets you use OpenTok video sessions in apps you build for iPad, iPhone, and iPod touch devices.' 
s.homepage = 'https://github.com/opentok/opentok-ios-sdk-webrtc/' 
s.license = { 
    :type => 'Apache' 
} 
s.source = { 
    :path => './OpenTok-iOS-2.3.0' 
} 
s.platforms = { 
    :ios => '5.0' 
} 
s.source_files = 'Opentok.framework/Versions/A/Headers/*.h' 
s.resources = 'Opentok.framework/Versions/A/Resources/opentok.bundle' 
s.frameworks = [ 
    "Opentok", 
    "UIKit", 
    "CoreMedia", 
    "CoreVideo", 
    "CoreAudio", 
    "CoreTelephony", 
    "CFNetwork", 
    "AVFoundation", 
    "SystemConfiguration", 
    "Security", 
    "QuartzCore", 
    "AudioToolbox", 
    "OpenGLES", 
    "MobileCoreServices" 
] 
s.libraries = [ 
    "stdc++", 
    "z" 
] 
s.xcconfig = { 
    :FRAMEWORK_SEARCH_PATHS => "\"frameworks/OpenTokSDK-WebRTC/\"" 
} 
s.preserve_paths = 'Opentok.framework' 
s.requires_arc = false 

end 

在Podfile相關線上

pod 'OpenTokSDK-WebRTC', :path => "frameworks" 

當我運行'pod install'一切似乎運行良好,但是在Pods目錄中沒有OpenTokSDK文件夾,並且在嘗試包含xcode時收到文件未找到錯誤。有誰知道我錯過了什麼? 感謝您的幫助。

+0

你的運氣如何? – 2014-10-29 14:15:52

回答

0

正如我在他們的博客上找到的,這裏是鏈接new-in-ios-10-the-best-webrtc-apps-yet。您需要在您的pod文件中添加pod 'OpenTok'。所以在您的項目中添加了更新版本的談話框。現在打開你的xcworkspace文件inplace of xcodeproj文件。

這裏是我的Podfile,

# Uncomment the next line to define a global platform for your project 
# platform :ios, '9.0' 

target 'ProjectName' do 
    # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 
    # use_frameworks! 
pod 'AFNetworking', '~> 3.0' 
pod 'OpenTok' 
    # Pods for ProjectName 

    target 'ProjectNameTest' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'ProjectNameUITests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

end 

注: -如果使用的是斯威夫特,那麼請取消註釋#use_frameworks!

更新您的pod文件後,在終端中輸入「pod install」命令。並且Tokbox將成功安裝在您的項目中。 enter image description here


enter image description here