framework 上传到 Cocoapods 遇到Returned an unsuccessful exit code?

发布于 2022-09-11 18:02:48 字数 8492 浏览 29 评论 0

问题描述

这周需要上传一个framework到cocoapods,但是不管怎么配置,都出现
xcodebuild: Returned an unsuccessful exit code?错误。百度过很多,都没有解决,问过同行朋友,也没有解决。同行朋友在一周之前还提交过一次framework,这周他我一样也无法将framework提交到cocoapods了,同样出现上面的错误

podspec文件配置如下

Pod::Spec.new do |spec|

spec.name         = "TestSpec"
spec.version      = "0.0.1"
spec.summary      = "A short description of TestSpec."
spec.description  = <<-DESC
                        TestSpec A short description of TestSpec.
                    DESC
spec.homepage     = "https://github.com/XXXX"
spec.license      = { :type => "MIT", :file => "LICENSE" }
spec.author             = { "XXX" => "XXXXXXXXX@qq.com" }
spec.platform     = :ios, "8.0"
spec.source       = { :git => "https://github.com/XXXX/TestSpec.git", :tag => "#{spec.version}" }

spec.source_files  = "TestSpec/Source/XXXX.framework/Headers/*.{h}", "*.{h,m}"
spec.vendored_frameworks = "TestSpec/Source/XXXX.framework"
spec.frameworks = 'UIKit',"Foundation"
spec.library   = "swiftCoreGraphics","swiftFoundation","swiftMetal","swiftDarwin","swiftUIKit","swiftObjectiveC","swiftDispatch","swiftCoreImage","swiftQuartzCore","swiftCore","swiftCoreFoundation"
spec.requires_arc = true
end

报错如下

....前面省略N行
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -L/Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Products/Release-iphonesimulator -F/Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Products/Release-iphonesimulator -F/var/folders/c7/54hc_jw16_9_bbw7zy1zv2l40000gn/T/CocoaPods-Lint-20190301-41041-rwdl11-TestSpec/Pods/TestSpec/TestSpec/Source -filelist /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lswiftCore -lswiftCoreFoundation -lswiftCoreGraphics -lswiftCoreImage -lswiftDarwin -lswiftDispatch -lswiftFoundation -lswiftMetal -lswiftObjectiveC -lswiftQuartzCore -lswiftUIKit -framework Foundation -framework PGTDWTKit -framework UIKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/App.app-Simulated.xcent -framework Foundation -framework Pods_App -Xlinker -dependency_info -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App_dependency_info.dat -o /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App
    ld: library not found for -lswiftCore
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    Ld /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App normal i386 (in target: App)
        cd /var/folders/c7/54hc_jw16_9_bbw7zy1zv2l40000gn/T/CocoaPods-Lint-20190301-41041-rwdl11-TestSpec
        export IPHONEOS_DEPLOYMENT_TARGET=8.0
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -L/Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Products/Release-iphonesimulator -F/Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Products/Release-iphonesimulator -F/var/folders/c7/54hc_jw16_9_bbw7zy1zv2l40000gn/T/CocoaPods-Lint-20190301-41041-rwdl11-TestSpec/Pods/TestSpec/TestSpec/Source -filelist /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lswiftCore -lswiftCoreFoundation -lswiftCoreGraphics -lswiftCoreImage -lswiftDarwin -lswiftDispatch -lswiftFoundation -lswiftMetal -lswiftObjectiveC -lswiftQuartzCore -lswiftUIKit -framework Foundation -framework PGTDWTKit -framework UIKit -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/App.app-Simulated.xcent -framework Foundation -framework Pods_App -Xlinker -dependency_info -Xlinker /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App_dependency_info.dat -o /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App
    ld: library not found for -lswiftCore
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
        Ld /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64
        Ld /Users/imac/Library/Developer/Xcode/DerivedData/App-evxrkdnhlwavnxevrdzxbgnlqpoa/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App normal i386
    (2 failures)
   Testing with `xcodebuild`. 
 -> TestSpec (0.0.1)
    - WARN  | summary: The summary is not meaningful.
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
    - NOTE  | xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Analyzed 1 podspec.

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

/Users/imac/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/cocoapods-1.7.0.beta.1/lib/cocoapods/command/spec/lint.rb:94:in `run'
/Users/imac/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/imac/.rvm/rubies/ruby-2.5.3/lib/ruby/gems/2.5.0/gems/cocoapods-1.7.0.beta.1/lib/cocoapods/command.rb:52:in `run'
/Users/imac/.rvm/gems/ruby-2.5.3@global/gems/cocoapods-1.7.0.beta.1/bin/pod:55:in `<top (required)>'
/Users/imac/.rvm/rubies/ruby-2.5.3/bin/pod:23:in `load'
/Users/imac/.rvm/rubies/ruby-2.5.3/bin/pod:23:in `<main>'
/Users/imac/.rvm/gems/ruby-2.5.3@global/bin/ruby_executable_hooks:24:in `eval'
/Users/imac/.rvm/gems/ruby-2.5.3@global/bin/ruby_executable_hooks:24:in `<main>'

神奇的事情是我的朋友上周才上传过一次framework到cocoapods,这周我出现这个问题的时候,请教他,他去上传也出现这个问题。 但是我们上传普通的代码就没有任何问题。

环境
macOS Mojave 10.14.2 (18C54)
xcode 10.1
pod 1.7.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空气里的味道 2022-09-18 18:02:48

~没人?~

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文