I'm trying to link to the Firebase SDK (v2.5.0) within my OS X framework, but it keeps telling me I am trying to link to a framework built for iOS.
It seems to state pretty clearly on the Firebase docs that the iOS framework can be used to build OS X clients as well, so does anyone know what I am doing wrong here?
ld: in /[...]/Firebase.framework/Firebase(Firebase.o), building for OSX, but linking in object file built for iOS, for architecture x86_64
As of 2.4.0 (changelog), Firebase no longer ships a single binary for iOS and OSX, but instead has multiple frameworks (Firebase.framework for iOS, FirebaseOSX.framework for OSX). Similarly, the iOS Cocoapod is named Firebase, while the OSX Cocoapod is named FirebaseOSX. This is due to several changes in our build process, such as adding bitcode support (which only makes sense on iOS).
We still build and release iOS and OSX through these channels, and continue to support OSX, though it's not heavily advertised (as you noticed). As mentioned, if you don't use Cocoapods, using https://cdn.firebase.com/ObjC/FirebasePlatform.framework-major.minor.patch.zip will get you the framework, then follow the Alternative Setup instructions for including it in your project.
You need to add some dependencies in your project's Build Phases:
libicucore.dylib
libc++.dylib
CFNetwork.framework
Security.framework
SystemConfiguration.framework
See the Apple docs on how to add these if you haven't done this before.
Ok, this is a bit weird.. But after digging around in the pod specs I noticed that the FirebaseOSX podspec links to a different url than the iOS pod (FirebaseOSX.framework and an older version).
So I decided to copy the framework url from the Firebase site, and change the name and try that, and it downloaded a OSX framework for me. This is really weird, because I can't for the life of me understand that I should do like that based on what I can read on the Firebase site, so I can't really consider this the official way as it doesn't really make any sense. But it seems to work for now..
So for v2.5.0 the url is:
https://cdn.firebase.com/ObjC/FirebaseOSX.framework-2.5.0.zip
Related
I am currently building code that I would really like to use as a framework by being able to import MyCustomFramework as I would with Apple frameworks (in the future I would also like to distribute them).
I have some questions about that :
What is the easiest way to build a framework as what I want? Is this possible to do it directly in Xcode or do I need to use command line tools in the Terminal?
Will this framework be compatible with multiple platforms (I am thinking about all Apple platforms but also about other platforms supported by Swift such as Linux).
What is exactly the link between Swift frameworks and the Swift Package Manager ? Do I need SPM to build my framework or is this two different tools?
Thank you.
Currently, Swift Package Manager (SPM) and Xcode Frameworks follow different paths. For Linux, you have to follow the SPM path since the only way to compile a Linux swift application is to use SPM. For macOS command line apps, you can follow the SPM path as well. For iOS apps and macOS UI apps, you have to follow the Xcode Frameworks path.
For the SPM path, you make the project of your framework SPM-enabled: add Package.swift file and set the file layout of your project according to SPM conventions. The project also has to be a git repository. Then the git repository of your project can be specified as a dependency to other SPM-enabled frameworks/applications. Each SPM-enabled project can be converted to an Xcode project any time by using swift package generate-xcodeproj command.
The Xcode Frameworks path is the standard, pre-SPM way of working with frameworks with Xcode, which is described elsewhere. You create an Xcode Project that will define your framework.
So, if you want your framework to be used both in SPM-enabled projects for Linux and macOS command line apps, and in Xcode-enabled projects for iOS and macOS UI apps, you have to follow the dual path. You make your project SPM-enabled and add an Xcode Project which will define your framework. You will have to maintain your project information twice - in Package.swift file and in the Xcode Project.
I gave a detailed answer on how to use Xcode to create a Framework target in an answer 2 weeks ago here. The question wasn't specifically related to Frameworks, so I can understand how it doesn't come up in a search. (I also believe if I copied/pasted it here that would be unwelcome, but if I'm wrong I'll do it.)
For now a Swift Framework target can be compatible across Apple platforms, provided you separate UIKit, Foundation, and core code into their own frameworks. (There may be a better way but that's the best way I know.
About Swift core code: Currently Swift is (still) evolving fast. Swift 3 is beginning to have production server-side use and some Linux use, but right now with no binary compatibility (that's part of Swift 4) I'd stick to Apple platforms.
I've heard conflicting things about Swift version compatibility between Swift 2 & 3. By this I mean you can use both in the same project, but there are hurdles if you do.
Running Xcode version 8.2.1, Swift 3, and Cocoapods version 1.1.1 and I can't for the life of me figure out how to resolve this issue. I need to use the analytics library but can't get past this error in the UIViewController+SEGScreen.m class:
Without forking, is there another solution here?
What exactly do you need to figure out? The API is not available when targeting iOS extensions. There is no solution but fixing the API. If this is an open source, the fix looks really simple (wrapping in a custom macro such #ifdef TARGET_EXTENSION). If not, time to use a properly written analytics framework, that takes into account all aspects of iOS development, not the most trivial ones only.
I'm using the mosync library for develop iPhone applications. It generates the Xcode project ,
now I need to compile it to make it run on a iphone. So for that I need a mac.
do anybody know somewhere online to find online compiler which do that with a web based interface?
--thanks in advance--
Its really a difficult ask, since apples terms of use on certificates stop people from doing this.
But I got a paid solution for the same problem you mentioned which provides Xcode on Macintosh with latest updates. It just cost about 10$-20$ per month. Initially, you will get the trial offer too. If you like it, then you can subscribe it.
But friends beware of those who provides hacintosh version.
You can refer to following link-
http://www.xcodeclub.com/
http://virtualmacosx.com/
If you want to compile C or C++ right on iPhone/iPad you can try CppCode ios app
I wanted to use CFHttpMessage and CFHttpRequest types in my application. I used it and found from documentation that to use it I will have to include CoreServices.framework in my application. When I tried to add that framework to my application, it was no there in the list of framework. I also checked the frameworks directory in finder but its not there. So its problem in the iOS sdk. I am not able to use the CFHttpMessage and CFHttpRequest types in my application, because it can not find the framework thats why it gives the linking error. At installation time of iOS sdk I chosen all the options and made full installation. So from where can I bring the CoreServices.framework in my application.
It doesn' exist: http://markmail.org/message/ib7kdwfpvoovomng
Having trouble linking the Stomp.framework into an iPhone SDK application.
http://code.google.com/p/stompframework/
I follow the instructions, adding it to the project, adding a Build Phase for Copying the Files, and including it via #import .
I keep getting "image not found".
Anyone try this and/or have a clear idea why?
This may be better:
http://github.com/juretta/objc-stomp
I found it fairly easy to get going.
The iPhone SDK doesn't support embedding frameworks in applications. I believe it supports dylibs, though I'm not certain of that fact. However, the safest thing to do would be to take the source of that framework and compile it directly into your application.
Make sure that whatever folder contains the .framework bundle is listed in the Framework Search Paths setting of your target or project.
There's more you'd need to do if you want to embed the framework in your application but that's another question.
edit: Totally ignored the iPhone requirement there, you'll have to compile the framework as a static library and link against that.