无法读取许可证文件LICENSE.txt-创建cocoapod

时间:2019-08-17 10:32:32

标签: ios swift cocoapods

我正在尝试创建一个cocoapod,但不断出现此错误:

Unable to read the license file `LICENSE.txt` for the spec 
'WhiteFlowerFactory (0.0.1)'

我的podspec代码:

spec.name = "WhiteFlowerFactory"
spec.version = "0.0.1"

spec.license = { :type => "MIT", :file => "LICENSE.txt" }

spec.source_files = "WhiteFlowerFactory/*.{swift}"

spec.platform = :ios
spec.ios.deployment_target = '11.0'

spec.swift_version = "5.0"

这是它出现在我的项目目录中的位置:

enter image description here

我尝试过的事情:

  • 将LICENSE.txt文件移动到第二个“ WhiteFlowerFactory”子目录
  • 重命名为LICENSE.md
  • 重命名为LICENSE(无扩展名)

无论如何,我不断收到相同的错误。

我也收到一个单独的错误,并且不确定是否与该错误有关,但是为了防万一,我将在此处添加它:

[iOS] unknown: Encountered an unknown error (Could not find a `ios` 
simulator (valid values: ). Ensure that Xcode -> Window -> Devices has
at least one `ios` simulator listed or otherwise add one.) during 
validation.

我两个小时都遇到了这两个错误。我删除了Xcode 10.2和11.0 beta版以及所有模拟器和派生数据,只是重新安装了Xcode 10.3及其模拟器。仍然收到两个错误。

编辑:刚刚从cocoapods 1.6.1-> 1.7.5更新,第二个错误已解决,仍然收到许可证错误:

Validating spec
-> WhiteFlowerFactory (0.0.1)
- WARN  | [iOS] license: Unable to find a license file
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | [iOS] xcodebuild:  note: Planning build
- NOTE  | [iOS] xcodebuild:  note: Constructing build description

[!] The `WhiteFlowerFactory.podspec` specification does not validate.

[!] Unable to read the license file `LICENSE.txt` for the spec `WhiteFlowerFactory (0.0.1)`

1 个答案:

答案 0 :(得分:0)

podspec应包含描述来源位置的来源字段。参见文档here。通常,它描述github存储库以及已推送到该存储库的基于版本的标记。