OSX application fails to compile after adding the Firebase Library

天大地大妈咪最大 提交于 2019-12-08 10:10:47

问题


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


回答1:


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>



回答2:


If you still getting errors after you have done the install and adding the #import .

Try this. Open Terminal, then cd to your project and type Pod Install, it will prompt you, says something like your project was edit by another application, if you want to Revert or Keep The XCode Version. Chose Revert.

This fixed my error. Hope will help others.



来源:https://stackoverflow.com/questions/31749176/osx-application-fails-to-compile-after-adding-the-firebase-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!