经过一整天我在遗留项目中修复了数十个错误,但我被这个恼人的问题所阻止。我在网上搜索过很多但是无法得到相关答案。
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC -ObjC
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -licucore
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -licucore is not an object file (not allowed in a library)
我应该在Build Settings或Build Phases中修改某些内容,还是在CocoaPods中修改某些内容
添加:构建目标时出错,以下是所有错误信息:
Libtool /Users/wangshudao/Library/Developer/Xcode/DerivedData/Diana-gfwxapulgdvudifuftotddpukijd/Build/Products/Debug-iphonesimulator/libDianaModels.a normal x86_64
cd /Volumes/HDD/Dev/workplace/iOS/Diana
export IPHONEOS_DEPLOYMENT_TARGET=6.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L/Users/wangshudao/Library/Developer/Xcode/DerivedData/Diana-gfwxapulgdvudifuftotddpukijd/Build/Products/Debug-iphonesimulator -filelist /Users/wangshudao/Library/Developer/Xcode/DerivedData/Diana-gfwxapulgdvudifuftotddpukijd/Build/Intermediates/Diana.build/Debug-iphonesimulator/DianaModels.build/Objects-normal/x86_64/DianaModels.LinkFileList -ObjC -lPods-Model-AFNetworking -lPods-Model-Mantle -lPods-Model-ReactiveCocoa -lPods-Model-SSKeychain -lPods-Model-TMCache -licucore -framework AVOSCloud -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreTelephony -framework Foundation -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -weak_framework UIKit -ObjC -lPods-Model-AFNetworking -lPods-Model-Mantle -lPods-Model-ReactiveCocoa -lPods-Model-SSKeychain -lPods-Model-TMCache -licucore -framework AVOSCloud -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreTelephony -framework Foundation -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -weak_framework UIKit -framework SystemConfiguration -framework MobileCoreServices -framework Foundation -lPods-Model -o /Users/wangshudao/Library/Developer/Xcode/DerivedData/Diana-gfwxapulgdvudifuftotddpukijd/Build/Products/Debug-iphonesimulator/libDianaModels.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:-dynamic未指定以下标志无效:-ObjC -ObjC 错误:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:无法找到以下文件:-licucore 错误:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:file:-licucore不是目标文件(库中不允许) 错误:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:无法找到以下文件:-licucore 错误:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:file:-licucore不是目标文件(库中不允许)
答案 0 :(得分:1)
我通过删除所有-l" icucore"来解决这个问题。在所有Pods.XXX.xcconfig文件中。它们是由CocoaPods自动生成的,我不知道如何控制这些链接器标志。无论如何,它现在有效......
答案 1 :(得分:0)
链接器的命令行选项告诉它在libicucore.a
中链接(可能;但也可能是libicucore.dylib
,但在iOS下不太可能。)
您必须提供库才能修复错误。
失败的其他潜在原因是:
-L
命令行选项中包含库的目录。请参阅此manpage,虽然它有些过时(我无法找到Apple ld
的当前联机帮助页。)
答案 2 :(得分:0)
尝试在项目的目标构建设置中的-licucore
中添加Other Linker Flags
标记。它可以解决你的问题。
答案 3 :(得分:0)
我在RegexKitLite
时遇到了类似的错误,我修复了这个设置: