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

博尔日

我需要在 cocoapods 上发布一个 MySDK.framework(混合 obj-c + Swift)。我按照使用 CocoaPods 在 Swift发布通用二进制 iOS 框架中的步骤进行操作

当我运行时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 时)。

我的SDK.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' => '[email protected]' }

  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
  • 如果我将框架添加到嵌入框架中,一切都会按预期工作。

  • 尝试干净的 Pods 缓存,没有运气

请帮忙!

博尔日

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

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何检查CocoaPods框架的版本

#if canImport()未找到带有CocoaPods的框架

在Flutter iOS平台特定代码中使用Cocoapods库

CircleCI for iOS-缓存cocoapods依赖项

从CocoaPods框架编辑锁定的文件

没有CocoaPods的GoogleMaps

通过CocoaPods安装Facebook iOS SDK

从Travis发布到CocoaPods

如何在iOS上的Cocoapods中使用Boost?

找不到带有Cocoapods 0.37,Swift,框架的GoogleAnalytics-iOS-SDK的标头

带有Cocoapods的Swift中的Facebook iOS SDK v 4.1.0:无法导入模块

如何使用Swift的私有iOS框架?

iOS-使用CocoaPods导入框架,但不能使用

iOS单元测试在CocoaPods Google Maps SDK上失败

带有-ObjC链接器标志且不带Cocoapods iOS的Firebase,Fabric和Crashlytics

找不到iOS Cocoapods文件错误

Facebook cocoapods'sharedApplication'不可用:在iOS(应用程序扩展)上不可用

由于Cocoapods安装失败,iOS框架添加失败

在iOS应用中发布“ pod install”后,放弃CocoaPods是否可行?

Cocoapods框架无法正确安装

带有/不带有cocoapods的iOS Admob Firebase SDK

iOS:使用框架时cocoaPods皮棉问题

如何从 Cocoapods 中提取框架

混淆通过 cocoapods 分发的 iOS 动态框架中的内部类

iOS - cocoapods 未更新

iOS - 如何在使用 cocoapods 的开发过程中管理框架的依赖关系?

我们需要为 CocoaPods 和 Carthage 创建 iOS 通用框架吗?

Cocoapods - 未找到框架 FirebaseCoreDiagnostics

带有 Google MLKit cocoapods 的 iOS Ad-hoc 分发