【问题标题】:Attempting to add OpenTok 2.3 as a local cocoapod尝试将 OpenTok 2.3 添加为本地 cocoapod
【发布时间】:2014-10-01 16:29:56
【问题描述】:

我需要将 OpenTok 2.3 添加到使用 cocoapods 的项目中,但是 pods 存储库或 github 上只有 2.1.7,所以我已经在本地下载了框架。我的文件夹结构如下所示:

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 文件夹,并且在尝试包含 .有谁知道我错过了什么? 感谢您的帮助。

【问题讨论】:

  • 你运气好吗?

标签: ios objective-c xcode cocoapods opentok


【解决方案1】:

正如我在他们的博客上找到的,这是链接new-in-ios-10-the-best-webrtc-apps-yet。您需要在您的 pod 文件中添加 pod 'OpenTok'。因此,更新版本的谈话框已添加到您的项目中。现在打开您的 xcworkspace 文件代替 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

注意:-如果您使用的是 Swift,请取消注释# use_frameworks!

更新您的 pod 文件后,在您的终端中输入“pod install”命令。并且 Tokbox 将成功安装在您的项目中。


【讨论】:

    猜你喜欢
    • 2021-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-15
    • 2018-11-14
    • 1970-01-01
    • 2016-06-12
    相关资源
    最近更新 更多