推送podspec为Cocoapods 0.39.0时链接器错误

时间:2015-11-30 09:39:42

标签: cocoapods ensembles

尝试推送最新的Ensembles podspec时出现链接失败。规格没有变化,但Cocoapods更新为0.39.0。 Xcode无疑也发生了变化,这可能是罪魁祸首,但我无法解释这个错误。

 -> Ensembles (1.4.3)
- ERROR | [Ensembles/Dropbox] xcodebuild: Returned an unsuccessful exit code.
- NOTE  | [Ensembles/Dropbox] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)
- NOTE  | [iOS] [Ensembles/Dropbox] xcodebuild:  fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/i386/Ensembles (No such file or directory)
- NOTE  | [iOS] [Ensembles/Dropbox] xcodebuild:  error: cannot parse the debug map for "/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator/Ensembles.framework/Ensembles": No such file or directory

我不确定链接失败是否导致其他错误,或者lipo错误是否导致链接失败。我无法找到有关链接器退出失败的更多信息。

任何人都知道可能导致这种情况的原因,以及解决方案可能是什么?

更新

我确实找到了我认为的根本错误:

Ld /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles normal x86_64 cd /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/Pods export IPHONEOS_DEPLOYMENT_TARGET=6.0 ... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -L/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator -F/var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Release-iphonesimulator -filelist /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles.LinkFileList -install_name @rpath/Ensembles.framework/Ensembles -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=6.0 -Xlinker -objc_abi_version -Xlinker 2 -framework CoreData -fobjc-arc -fobjc-link-runtime -framework CoreData -framework Foundation -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles_dependency_info.dat -o /var/folders/73/p30wh95r8xjgmv001s6rxw080000gr/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/Ensembles.build/Objects-normal/x86_64/Ensembles ld: warning: embedded dylibs/frameworks only run on iOS 8 or later Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_DBRestClient", referenced from: objc-class-ref in CDEDropboxCloudFileSystem.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

看起来Cocoapods正在尝试创建一个动态库,而这在某种程度上不适用于iPhone模拟器架构的旧版Dropbox库。有人知道这方面的变化,也许是防止Cocoapods使用动态库的方法吗?

2 个答案:

答案 0 :(得分:0)

我发现了问题:默认情况下,Cocoapods似乎已经开始构建动态框架而不是静态库。显然链接到我正在使用的旧Dropbox pod是一个问题。

要使用静态库,只需将--use-libraries传递给正在运行的pod trunk pushpod lib lint命令。

答案 1 :(得分:0)

pod lib lint命令将检查*.podspec文件中的选项。就我而言,问题显示如下:

->  MySDK git:(master) ✗ pod lib lint --allow-warnings
 -> MySDK (0.0.1)
    - WARN  | description: The description is shorter than the summary.
    - ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - NOTE  | [OSX] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)

[OSX]标志显示pod lib lint命令尝试根据您的*.podspec文件构建项目,但在OSX平台中构建项目时发生了错误。

我的解决方案是在podspec文件中添加s.platform = :ios, "5.0"

之后,运行pod lib lint一切正常。