Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.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在cocoapods上发布私有代码框架_Ios_Swift_Xcode_Frameworks_Cocoapods - Fatal编程技术网

iOS在cocoapods上发布私有代码框架

iOS在cocoapods上发布私有代码框架,ios,swift,xcode,frameworks,cocoapods,Ios,Swift,Xcode,Frameworks,Cocoapods,我需要在cocoapods上发布一个MySDK.framework(混合obj-c+Swift)。我循序渐进 当我运行pod install时,它会显示: Analyzing dependencies Fetching podspec for `MySDK` from `..` Downloading dependencies Using AFNetworking (3.1.0) Using Crashlytics (3.9.3) Using FXBlurView (1.6.4) Using F

我需要在cocoapods上发布一个MySDK.framework(混合obj-c+Swift)。我循序渐进

当我运行
pod install
时,它会显示:

Analyzing dependencies
Fetching podspec for `MySDK` from `..`
Downloading dependencies
Using AFNetworking (3.1.0)
Using Crashlytics (3.9.3)
Using FXBlurView (1.6.4)
Using Fabric (1.7.2)
Using HexColors (2.3.0)
Using JSONModel (1.7.0)
Using KVOController (1.2.0)
Using Masonry (1.0.2)
Using SAMKeychain (1.5.3)
Using SDWebImage (3.8.2)
Using SnapKit (3.0.2)
Using SwiftyBeaver (1.2.2)
Using Toast (3.1.0)
Using YYImage (1.0.4)
Using MySDK (0.0.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 15 total pods installed.
但是,MySDK.zip既没有下载也没有安装在Pods项目中,所以Xcode抱怨缺少模块MySDK(在导入MySDK时)

MySDK.podspec

#
# Be sure to run `pod lib lint MySDK.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'MySDK'
  s.version          = '0.0.1'
  s.summary          = 'A short description of MySDK.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
                   MySDK framework for iOS.

                   * TODO: where docs are?
                   DESC

  s.homepage         = 'http://www.MySDK.com'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'Apache 2', :file => 'LICENSE' }
  s.author           = { 'me' => 'my-email@email.com' }

  s.ios.deployment_target = '8.0'
  s.source            = { :http => 'http://working-link.to/MySDK.framework.zip' }
  s.ios.vendored_frameworks = 'MySDK.framework'

  s.frameworks = 'UIKit'

  s.dependency 'AFNetworking', '~> 3.1.0'
  s.dependency 'Crashlytics', '~> 3.9.3'
  s.dependency 'Fabric', '~> 1.7.2'
  s.dependency 'JSONModel', '~> 1.7.0'
  s.dependency 'KVOController', '~> 1.2.0'
  s.dependency 'Masonry', '~> 1.0.2'
  s.dependency 'SAMKeychain', '~> 1.5.3'
  s.dependency 'SDWebImage', '~> 3.8.2'
  s.dependency 'SnapKit', '~> 3.0.0'
  s.dependency 'SwiftyBeaver', '~> 1.2.2'
  s.dependency 'Toast', '~> 3.1.0'
  s.dependency 'YYImage', '~> 1.0.4'

end
#
#确保运行'pod lib lint MySDK.podspec'以确保这是一个
#提交前请确认有效的规范。
#
#任何以#开头的行都是可选的,但鼓励使用
#要了解有关Podspec的更多信息,请参阅http://guides.cocoapods.org/syntax/podspec.html
#
Pod::规格新do | s|
s、 名称='MySDK'
s、 版本='0.0.1'
s、 summary='对MySDK的简短描述'
#此说明用于生成标记和改进搜索结果。
#*思考:它能做什么?你为什么写它?重点是什么?
#*尽量简短、简洁、切中要害。
#*在下面的描述分隔符之间写入说明。
#*最后,不要担心缩进,CocoaPods会将其剥离!
s、 description='LICENSE'}
s、 作者={'me'=>'my-email@email.com' }
s、 ios.deployment_target='8.0'
s、 source={:http=>'http://working-link.to/MySDK.framework.zip' }
s、 ios.vendored_frameworks='MySDK.framework'
s、 框架='UIKit'
s、 依赖项“AFNetworking”,“~>3.1.0”
s、 依赖项“Crashlytics”,“~>3.9.3”
s、 依赖项“结构”,“~>1.7.2”
s、 依赖项“JSONModel”,“~>1.7.0”
s、 依赖项“KVOController”,“~>1.2.0”
s、 依赖项“砌体”,“大于1.0.2”
s、 依赖项“SAMKeychain”,“~>1.5.3”
s、 依赖项“SDWebImage”,“~>3.8.2”
s、 依赖项“SnapKit”,“~>3.0.0”
s、 依赖项“SwiftyBeaver”,“~>1.2.2”
s、 依赖项“Toast”,“~>3.1.0”
s、 依赖项“YYImage”,“~>1.0.4”
结束
  • 如果我将框架添加到嵌入框架中,那么一切都会按预期进行

  • 尝试清理豆荚缓存,没有运气


请帮忙

在Podfile中使用
:podspec
而不是
:path
使其工作(因为在提供的教程中使用了
:path
):


有进展吗?我也有同样的问题!你把问题直接贴到cocoapods上了吗?@AaronBratcher,是的,把答案贴出来了
target 'MySDK-example' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MySDK-example
  pod 'MySDK', :podspec => '..'
end