添加Firebase库之后,OSX应用程序无法编译 [英] OSX application fails to compile after adding the Firebase Library
问题描述
$ b
在安装最新版本的cocoapods(0.38.2)并创建Podfile之后:
#取消注释此行为您的项目定义全球平台
platform:osx,'10 .10'
pod'Firebase','> = 2.3 .3'
target'dTrain-osx-agent'do
end
target'dTrain-osx-agentTests'do
end
我得到以下的构建失败错误:
Ld / Users / user / Library / Developer / Xcode / DerivedData / dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw / Build / Products / Debug / dTrain-osx- agent.app/Contents/MacOS/dTrain-osx-agent normal x86_64
cd / Users / user / Projects / interop / dtrain_osx / dTrain-osx-agent
export MACOSX_DEPLOYMENT_TARGET = 10.10
/ Applications /Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Dev eloper / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.10.sdk -L / Users / user / Library / Developer / Xcode / DerivedData / dTrain-osx-agent -djvvfitvallgicbrsrwbnbhaxoqw / Build / Products / Debug -F / Users / / Developer / Xcode / DerivedData / dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw / Build / Products / Debug -F / Users / user / Projects / interop / dtrain_osx / dTrain-osx-agent / Pods / Firebase -filelist / Users /用户/资源库/开发商/ Xcode中/ DerivedData / dTrain-OSX剂-djvvfitvallgicbrsrwbnbhaxoqw /建造/中间体/ dTrain-osx-agent.build /调试/ dTrain-osx-agent.build /对象 - 正常/ x86_64的/ dTrain-osx- agent.LinkFileList -Xlinker -rpath -Xlinker @executable_path /../ Frameworks -mmacosx-version -min = 10.10 -ObjC -lc ++ -licucore -framework CFNetwork -framework Firebase -framework Security -framework SystemConfiguration -L / Applications / Xcode.app /Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker / Users / user / Library / Developer / Xcode / DerivedData / dTrain-osx-agent-djvvf itvallgicbrsrwbnbhaxoqw / Build / Intermediates / dTrain-osx-agent.build / Debug / dTrain-osx-agent.build / Objects-normal / x86_64 / dTrain_osx_agent.swiftmodule -lPods -Xlinker -dependency_info -Xlinker / Users / user / Library / Developer / Xcode / DerivedData / dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw / Build / Intermediates / dTrain-osx-agent.build / Debug / dTrain-osx-agent.build / Objects-normal / x86_64 / dTrain-osx-agent_dependency_info.dat -o /用户/用户/库/开发人员/ Xcode / DerivedData / dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw / Build / Products / Debug / dTrain-osx-agent.app /目录/ MacOS / dTrain-osx-agent
ld:未找到框架OpenGLES for architecture x86_64
clang:error:linker命令失败,退出代码1(使用-v查看调用)
编辑:
XCode已升级到6.4(6E35b),仍然面临问题
pod'Firebase ','2.3.2'
同时,我们会调查并尝试在未来SDK的版本。注意,如果您使用的是Swift和Firebase SDK 2.3.2,则需要使用桥接标头导入Firebase到一个快速的应用程序。
为此,在您的项目中创建一个新的Objective-C文件。当提示您是否要包含桥接标头时,请说是。然后,删除您创建的.m文件,只保留为您创建的bridging-header.h文件。将以下行添加到该文件中:
#import< Firebase / Firebase.h>
I'm building a windowless menubar application (agent) with a popover. This application requires an integration with Firebase to retrieve some data from this store. XCode version is 6.3.
After installing the latest version of cocoapods (0.38.2) and creating the Podfile as such:
# Uncomment this line to define a global platform for your project
platform :osx, '10.10'
pod 'Firebase', '>= 2.3.3'
target 'dTrain-osx-agent' do
end
target 'dTrain-osx-agentTests' do
end
I'm getting the following build failure error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Products/Debug/dTrain-osx-agent.app/Contents/MacOS/dTrain-osx-agent normal x86_64
cd /Users/user/Projects/interop/dtrain_osx/dTrain-osx-agent
export MACOSX_DEPLOYMENT_TARGET=10.10
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Products/Debug -F/Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Products/Debug -F/Users/user/Projects/interop/dtrain_osx/dTrain-osx-agent/Pods/Firebase -filelist /Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Intermediates/dTrain-osx-agent.build/Debug/dTrain-osx-agent.build/Objects-normal/x86_64/dTrain-osx-agent.LinkFileList -Xlinker -rpath -Xlinker @executable_path/../Frameworks -mmacosx-version-min=10.10 -ObjC -lc++ -licucore -framework CFNetwork -framework Firebase -framework Security -framework SystemConfiguration -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -Xlinker -add_ast_path -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Intermediates/dTrain-osx-agent.build/Debug/dTrain-osx-agent.build/Objects-normal/x86_64/dTrain_osx_agent.swiftmodule -lPods -Xlinker -dependency_info -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Intermediates/dTrain-osx-agent.build/Debug/dTrain-osx-agent.build/Objects-normal/x86_64/dTrain-osx-agent_dependency_info.dat -o /Users/user/Library/Developer/Xcode/DerivedData/dTrain-osx-agent-djvvfitvallgicbrsrwbnbhaxoqw/Build/Products/Debug/dTrain-osx-agent.app/Contents/MacOS/dTrain-osx-agent
ld: framework not found OpenGLES for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Edit: XCode upgraded to 6.4 (6E35b) and still facing the problem
It looks like this issue is a result of some changes we made to how we build the Firebase SDK in 2.3.3. For now, can you pleas use the 2.3.2 version of the SDK, by modifying your Podfile as such:
pod 'Firebase', '2.3.2'
Meanwhile we'll investigate and try to get this fixed in a future version of the SDK. I'll update this answer once we do.
Note that if you're using Swift and Firebase SDK 2.3.2, you'll need to use a bridging header to import Firebase into a swift app.
To do that, create a new Objective-C file in your project. When prompted if you would like to include a bridging header, say "yes". Then, delete the .m file that you created, keeping only the bridging-header.h file that was created for you. Add the following line to that file:
#import <Firebase/Firebase.h>
这篇关于添加Firebase库之后,OSX应用程序无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!