首页 > 解决方案 > 由于以下消息,Pod 规范 lint 失败

问题描述

我想在 Github 上发布我的 pod,但是当我在终端中使用 podspec lint 命令时遇到了这个错误

pod spec lint    
Ignoring digest-crc-0.6.3 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.3
Ignoring unf_ext-0.0.7.7 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.7

-> MyPodName (1.0.2)
- WARN  | [iOS] swift: The validator used Swift `4.0` by default because no Swift version was specified. To specify a Swift version during validation, add the `swift_versions` attribute in your podspec. Note that usage of a `.swift-version` file is now deprecated.
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE  | xcodebuild:  note: Using new build system
- NOTE  | xcodebuild:  note: Building targets in parallel
- NOTE  | xcodebuild:  note: Using codesigning identity override: -
- NOTE  | xcodebuild:  note: Build preparation complete
- NOTE  | [iOS] xcodebuild:  note: Planning build
- NOTE  | [iOS] xcodebuild:  note: Analyzing workspace
- NOTE  | [iOS] xcodebuild:  note: Constructing build description
- NOTE  | xcodebuild:  error: Unexpected duplicate tasks:
- NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'arm64' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'arm64' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'x86_64' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'x86_64' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'i386' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'MyPodName/MyPodName/MyPodName.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'i386' (in target 'MyPodName' from project 'Pods')
- NOTE  | [iOS] xcodebuild:  warning: duplicate output file '/Users/MyName/Library/Developer/Xcode/DerivedData/App-axxipgdxvmqnvletiqbakcsseqkn/Build/Products/Release-iphonesimulator/MyPodName/MyPodName.framework/Info.plist' on task: ProcessInfoPlistFile /Users/MyName/Library/Developer/Xcode/DerivedData/App-axxipgdxvmqnvletiqbakcsseqkn/Build/Products/Release-iphonesimulator/MyPodName/MyPodName.framework/Info.plist Target Support Files/MyPodName/MyPodName-Info.plist (in target 'MyPodName' from project 'Pods')

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error and 1 warning.

虽然我将 swift 版本更改为,5.0但我不确定问题是

cat swift-version   

将返回

5.0

这是我的 podspec 文件

Pod::Spec.new do |spec|

spec.name         = "MyPodName"
spec.version      = "1.0.2"
spec.summary      = "Pod Summary"
spec.description  = "Pod Description"
spec.homepage     = "https://github.com/MyName/MyPodName"
spec.license      = "MIT"
spec.author       = { "MyName" => "MyName.sr@gmail.com" }
spec.platform     = :ios, "9.0"
spec.source       = { :git => "https://github.com/MyName/MyPodName.git", :tag => "1.0.2" }
spec.source_files = "MyPodName/**/*"

end

标签: iosswiftcocoapodspodspec

解决方案


推荐阅读