我在目标c中制作了一个.framework,我用cocoapods创建了一个私有存储库,一切运行良好 .

但是现在......我不得不在我的.framework中添加DFU模式更新功能,因为我使用了这里的库[https://github.com/NordicSemiconductor/IOS-Pods-DFU-Library/blob/master/README_OBJC.md][1]

为了能够将这个库与cocoa一起使用,我必须使用cocoapod install将项目传递到工作区,并将依赖项放在我的目标c代码中 .

#import <iOSDFULibrary/iOSDFULibrary-Swift.h>
@import iOSDFULibrary;

我的代码编译,似乎一切都很好 . 但是当我运行pod spec lint时,我得到以下错误,

PruebaFramework $pod spec lint  DSFramework.podspec --allow-warnings  --use-libraries --verbose

    DSFramework (1.99.999) - Analyzing on iOS 8.0 platform.
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-App`: (``)

Fetching external sources
-> Fetching podspec for `DSFramework` from `/Applications/Programacion/PruebaFramework/DSFramework.podspec`

Resolving dependencies of 

Comparing resolved specification to the sandbox manifest
  A DSFramework
  A Zip
  A iOSDFULibrary

Downloading dependencies

-> Installing DSFramework (1.99.999)
  > Copying DSFramework from
  `/Users/administrador/Library/Caches/CocoaPods/Pods/External/DSFramework/035395061a29836d834f6bc0d067a91f-f3310`
  to `../../../../private/var/folders/lf/5hd49f8s24bd0k38_x5sgzt00000gp/T/CocoaPods/Lint/Pods/DSFramework`

-> Installing Zip (0.7.0)
  > Copying Zip from `/Users/administrador/Library/Caches/CocoaPods/Pods/Release/Zip/0.7.0-e3451` to
  `../../../../private/var/folders/lf/5hd49f8s24bd0k38_x5sgzt00000gp/T/CocoaPods/Lint/Pods/Zip`

-> Installing iOSDFULibrary (3.0.6)
  > Copying iOSDFULibrary from
  `/Users/administrador/Library/Caches/CocoaPods/Pods/Release/iOSDFULibrary/3.0.6-e9f78` to
  `../../../../private/var/folders/lf/5hd49f8s24bd0k38_x5sgzt00000gp/T/CocoaPods/Lint/Pods/iOSDFULibrary`
  - Running pre install hooks
 -> DSFramework (1.99.999)
    - WARN  | description: The description is shorter than the summary.
    - WARN  | url: There was a problem validating the URL https:xxxxxxxxx
    **- ERROR | [iOS] unknown: Encountered an unknown error (Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pods being used are: Zip and iOSDFULibrary**
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:450:in `block (2 levels) in verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:445:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:445:in `block in verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:442:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/installer.rb:442:in `verify_framework_usage'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:486:in `block in install_pod'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:486:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:486:in `install_pod'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:306:in `block in perform_extensive_analysis'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:298:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:298:in `perform_extensive_analysis'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/validator.rb:79:in `validate'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command/spec/lint.rb:67:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command/spec/lint.rb:55:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command/spec/lint.rb:55:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
) during validation.

Analyzed 1 podspec.

**[!] The spec did not pass validation, due to 1 error.
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: 
    `echo "2.3" > .swift-version`.**

/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command/spec/lint.rb:84:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

我可以看到2个错误......

ERROR | [iOS] unknown: Encountered an unknown error (Pods written in Swift can only be integrated as frameworks; add use_frameworks! to your Podfile or target to opt into using it. The Swift Pods being used are: Zip and iOSDFULibrary

[!] The spec did not pass validation, due to 1 error. [!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a .swift-version file to set the version for your Pod. For example to use Swift 2.3, run: echo "2.3" > .swift-version.

我的podespec

Pod::Spec.new do |s|
  s.name             = 'MyFramework'
  s.version          = '1.99.999'
  s.summary          = ''
  s.description      ='Framework'

  s.homepage         = 'https://xxxxxxxxxxxxxxxx'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'xxx' => 'xxxxxx@gmail.com' }
  s.source           = { :git => 'xxxxxxxxxxxxx', :tag =>s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.ios.deployment_target = '8.0'
  #s.source_files = 'Library/Classes/**/*'
  s.source_files = "MyFramework/*.{h,m}",'MyFramework/MyFrameworkIBeaconBLE.framework/Headers/*.h'

  # s.resource_bundles = {
  #   'Library' => ['Library/Assets/*.png']
  # }

  s.public_header_files = 'MyFramework/MyFrameworkIBeaconBLE.framework/Headers/*.h'
  #s.framework = ''
  s.ios.vendored_framework= 'MyFramework/MyFrameworkIBeaconBLE.framework'
  s.dependency 'iOSDFULibrary'
end

我的pod版本

pod --version
1.2.1