1

尝试推送最新的 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 使用动态库的方法?

4

2 回答 2

0

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

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

于 2015-11-30T19:06:52.130 回答
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 平台中构建项目时发生了错误。

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

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

于 2016-09-03T09:18:57.857 回答