After a whole day I've fixed tens of error in a legacy project, but I'm blocked by this annoying problem. I've searched a lot on the web but cannot get a relevant answer to this.
一天之后,我修复了遗留项目中的几十个错误,但是这个烦人的问题阻止了我。我在网上搜索了很多,但是找不到相关的答案。
/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)
Should I modify something in Build Settings or Build Phases, or somewhere in CocoaPods???
我应该在构建环境或构建阶段修改某些东西,还是在茧中修改某些东西?
Add: Error happens on building a target and here are all the error info:
添加:在构建目标时发生错误,这里是所有的错误信息:
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 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) 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)
/应用程序/ xcode /内容/开发/工具链/ XcodeDefault。-dynamic没有指定以下标志无效:-ObjC -ObjC错误:/ application /Xcode.app/ content /Developer/ toolchain/ XcodeDefault。xctoolchain/usr/bin/libtool:无法定位文件:-licucore错误:/ application /Xcode.app/ content /Developer/ toolchain/ XcodeDefault。-licucore不是对象文件(库中不允许)错误:/ application /Xcode.app/ content /Developer/ toolchain/ XcodeDefault。xctoolchain/usr/bin/libtool:无法定位文件:-licucore错误:/应用程序/Xcode.app/内容/开发者/工具链/XcodeDefault。xctoolchain/usr/bin/libtool:文件:-licucore不是一个对象文件(在库中是不允许的)
4 个解决方案
#1
0
It's the command line option to the linker to tell it to link in libicucore.a
(probably; but could also potentially be libicucore.dylib
, but not likely under iOS).
链接器的命令行选项告诉它在libicucore中链接。一个(可能;但也可能是脂双核。dylib,但在iOS中不太可能。
You have to supply the library in order to fix the error.
为了修复错误,您必须提供库。
Other potential reasons for the failure are:
失败的其他潜在原因是:
- Not including the directory containing the library in any
-L
command line options. - 不包括任何-L命令行选项中包含库的目录。
- The "fat" library file not including the necessary CPU architecture, although the linker will produce a slightly different error message in that case.
- “fat”库文件不包括必要的CPU体系结构,不过在这种情况下,链接器将产生稍微不同的错误消息。
See this manpage, although it's somewhat out-of-date (I cannot find Apple's current manpage for ld
).
请查看这个manpage,尽管它有些过时(我找不到苹果当前的ld manpage)。
#2
0
Try to add -licucore
flag in Other Linker Flags
in your project's target Build Settings. It may solve your problem.
尝试在项目目标构建设置中的其他链接器标志中添加-licucore标志。它可能会解决你的问题。
#3
0
I came across similar error with RegexKitLite
, and I fixed with this settings:
我在RegexKitLite上遇到了类似的错误,我修复了以下设置:
#4
0
I fixed this by removing all the -l"icucore" in all the Pods.XXX.xcconfig files. They are auto-generated by the CocoaPods and I don't know how to control the these linker flags. Whatever, it works now...
我通过删除所有播客中的-l“icucore”来解决这个问题。xcconfig文件。它们是由可可粉自动生成的,我不知道如何控制这些链接器标志。无论如何,现在工作…
#1
0
It's the command line option to the linker to tell it to link in libicucore.a
(probably; but could also potentially be libicucore.dylib
, but not likely under iOS).
链接器的命令行选项告诉它在libicucore中链接。一个(可能;但也可能是脂双核。dylib,但在iOS中不太可能。
You have to supply the library in order to fix the error.
为了修复错误,您必须提供库。
Other potential reasons for the failure are:
失败的其他潜在原因是:
- Not including the directory containing the library in any
-L
command line options. - 不包括任何-L命令行选项中包含库的目录。
- The "fat" library file not including the necessary CPU architecture, although the linker will produce a slightly different error message in that case.
- “fat”库文件不包括必要的CPU体系结构,不过在这种情况下,链接器将产生稍微不同的错误消息。
See this manpage, although it's somewhat out-of-date (I cannot find Apple's current manpage for ld
).
请查看这个manpage,尽管它有些过时(我找不到苹果当前的ld manpage)。
#2
0
Try to add -licucore
flag in Other Linker Flags
in your project's target Build Settings. It may solve your problem.
尝试在项目目标构建设置中的其他链接器标志中添加-licucore标志。它可能会解决你的问题。
#3
0
I came across similar error with RegexKitLite
, and I fixed with this settings:
我在RegexKitLite上遇到了类似的错误,我修复了以下设置:
#4
0
I fixed this by removing all the -l"icucore" in all the Pods.XXX.xcconfig files. They are auto-generated by the CocoaPods and I don't know how to control the these linker flags. Whatever, it works now...
我通过删除所有播客中的-l“icucore”来解决这个问题。xcconfig文件。它们是由可可粉自动生成的,我不知道如何控制这些链接器标志。无论如何,现在工作…