尝试发布Pod后出现“xcodebuild:Returned an unsuccessful exit code”错误

11

执行 'pod trunk push --verbose' 命令后,会输出以下内容:

Build settings from command line:
CODE_SIGN_IDENTITY = -
SDKROOT = iphonesimulator10.1

=== CLEAN TARGET GTNetworkQualityChecker OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies
** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Stack:
  0   __exceptionPreprocess (in CoreFoundation)
  1   objc_exception_throw (in libobjc.A.dylib)
  2   -[__NSArrayM insertObject:atIndex:] (in CoreFoundation)
  3   -[XCCompilerSpecificationIBStoryboardLinker _outputNodesForInputNodes:withMacroExpansionScope:] (in DevToolsCore)
  4   -[XCCompilerSpecificationIBStoryboardLinker doSpecialDependencySetupForCommand:withInputNodes:withMacroExpansionScope:] (in DevToolsCore)
  5   -[XCCommandLineToolSpecification createCommandsforInputs:withMacroExpansionScope:] (in DevToolsCore)
  6   -[PBXTargetBuildContext invokeTask:forInputs:withMacroExpansionScope:optionTable:] (in DevToolsCore)
  7   -[XCDependencyGraphCreationContext invokeTask:forInputs:withMacroExpansionScope:optionTable:] (in DevToolsCore)
  8   -[XCCompilerSpecification computeDependenciesForInputNodes:ofType:variant:architecture:outputDirectory:withMacroExpansionScope:] (in DevToolsCore)
  9   -[XCCompilerSpecification computeDependenciesForFilePath:ofType:outputDirectory:withMacroExpansionScope:] (in DevToolsCore)
 10   -[XCBuildRuleDGSnapshot(DependencyGraphCreation) computeDependenciesForFilePath:ofType:forBuildFileReference:withOutputDirectory:parameterMacros:withMacroExpansionScope:] (in DevToolsCore)
 11   -[XCBuildRuleDGSnapshot(DependencyGraphCreation) computeDependenciesForBuildFileReference:withOutputDirectory:parameterMacros:withMacroExpansionScope:] (in DevToolsCore)
 12   -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) _computeDependenciesForBuildFileReference:usingBuildRule:withMacroExpansionScope:processedPaths:] (in DevToolsCore)
 13   -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForBuildFileReference:usingBuildRule:withMacroExpansionScope:] (in DevToolsCore)
 14   -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForBuildFileReference:withMacroExpansionScope:] (in DevToolsCore)
 15   -[XCBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForAllBuildFileReferencesWithMacroExpansionScope:] (in DevToolsCore)
 16   -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesForAllBuildFileReferencesWithMacroExpansionScope:] (in DevToolsCore)
 17   -[XCSourcesBuildPhaseDGSnapshot(DependencyGraphCreation) computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 18   -[XCProductTypeSpecification computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 19   -[XCNativeTargetDGSnapshot(DependencyGraphCreation) computeDependenciesWithMacroExpansionScope:] (in DevToolsCore)
 20   -[PBXTargetBuildContext createDependencyGraphWithTargetDGSnapshot:] (in DevToolsCore)
 21   -[PBXTargetBuildContext(DependencyGraphEvents) dg_setTargetSnapshot:] (in DevToolsCore)
 22   -[PBXTargetBuildContext(DependencyGraphEvents) processDependencyGraphEvents] (in DevToolsCore)
 23   -[XCBlockQueue _processNextBlockInThreadSlotNumber:] (in DevToolsCore)
 24   -[XCBlockQueue _processBlocksInThreadSlotNumber:] (in DevToolsCore)
 25   __NSThread__start__ (in Foundation)
 26   _pthread_body (in libsystem_pthread.dylib)
 27   _pthread_body (in libsystem_pthread.dylib)
 28   thread_start (in libsystem_pthread.dylib)

 -> GTNetworkQualityChecker (0.1.0)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

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

我使用的是Xcode 8.1和Cocoapods 1.2.0,Pod的存储库在这里

请问有人能告诉我这个问题的原因以及如何解决吗?


当我尝试通过 pod spec lint --verbose GTNetworkQualityChecker.podspec 验证您的仓库时,我遇到了一个关于缺少 FrameworkStoryboard.storyboard 的错误。我没有看到它被提交到您的仓库中。 - Michael Dautermann
@Michael Dautermann,你知道为什么项目要找到这个文件吗? - ArtStyle
3个回答

3
问题出在您的podspec文件中的这一行代码:
s.source = { :git => 'https://github.com/Ar7Style/GTNetworkQualityChecker.git', :tag => s.version.to_s }
:tag是问题所在。您当前的Pod验证不知道哪个提交代表您想要发布的确定版本的结束,即您的"0.1.0"版本。这就是为什么验证步骤引用了您存储库的旧版本(在那里您确实拥有 FrameworkStoryboard.storyboard在您删除它之前)。
换句话说,您需要使用与版本号对应的标签标记您的Pod
例如,在命令行中:
git tag '0.1.0' # the version number you're using for this release
git push --tags

那么请按照我之前展示的验证步骤进行验证:
pod spec lint --verbose GTNetworkQualityChecker.podspec

如果没问题的话,你应该执行pod trunk push --verbose命令。


2

当您设置错误的路径到源代码时,可能会出现此错误。请再仔细检查一遍。 它应该类似于:

s.source_files = "EXPLogger/*.{h,m,swift}"

1

在Cocoapods中,StoryBoard不能作为源文件。如果您想将其添加到Cocoapods,请将其添加到资源文件模式中。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接