我使用“ pod lib create”命令创建了两个私有的cocoapod库A和B。
我写了一个Podfile和A的A.podspec来在A pod中使用B pod,如下所示。 (当然,B pod是使用“ pod repo push”命令上传的。我还创建了一个应用程序来测试B pod是否可用。)
这是图书馆的Podfile。
use_frameworks!
target 'A_Example' do
pod 'A', :path => '../'
pod 'B', :git => 'https://~~/b.git', :tag => '0.0.1'
target 'A_Tests' do
inherit! :search_paths
end
end
这是图书馆的podspec
Pod::Spec.new do |s|
s.name = 'A'
s.version = '0.0.2'
s.summary = 'summary of A pod'
s.swift_version = '4.0'
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://bitbucket.org/000/000'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Hyobin Kim' => 'myemail' }
s.source = { :git => 'https://dolfu@bitbucket.org/~~/A.git', :tag => s.version.to_s }
s.ios.deployment_target = '10.0'
s.source_files = 'A/Classes/**/*'
s.dependency 'B'
end
这通常在xcode中构建。
但是,当您在终端上使用'pod spec lint'命令时,它会显示以下消息:
ERROR | [iOS] unknown: Encountered an unknown error (Unable to find a specification for `B` depended upon by `A`) during validation
为解决此问题,我输入了'pod spec lint --sources ='https:// ~~ / b.git”,但显示了以下消息。
Encountered an unknown error (An unexpected version directory `Classes` was encountered for the `/Users/dolfu/.cocoapods/repos/bitbucket-b/B` Pod in the `B` repository.) during validation
解决此问题的方法是什么? 我要求您好的答复。 (如果您有很好的例子,请写您的链接)