Closed okydk closed 5 years ago
We can't add Carthage support via a shared framework scheme for the time being since all the Firebase libraries have a common dependency in Analytics, which is still closed source and vended as a static library. If we were to try to distribute the other Firebase libs as dynamic frameworks, they would all have link time dependencies on Analytics and would end up duplicating the Analytics classes in the runtime, bloating app size and causing undefined behavior in some instances.
Carthage does support vending binaries, so we could still distribute these as static binaries with static dependencies on Analytics. Others wouldn't be able to easily build and redistribute libraries wrapping Firebase, but otherwise we'd retain many of the benefits of using Carthage. But before this can happen Analytics also needs to be distributed through Carthage, since mixing dependency managers is not something we should encourage developers to do.
The most straightforward solution would be to distribute Analytics as a dynamic framework through Carthage and then build the open source Firebase frameworks on top of that via a shared framework scheme. This is unlikely to happen in the very short term. In the longer term, we'd need to weigh the drawback of causing longer app launch times for dylib users versus the benefit of allowing users to install Firebase through Carthage and easily build frameworks wrapping Firebase. If you have either of these concerns (app launch times/want to build on top of Firebase), please share your thoughts!
Ok, fingers crossed for support in the future 🤞 and thanks for the clarification.
For time being I already created a carthage compatible for firebase. https://github.com/soheilbm/firebase
@morganchen12 I'm very much interested in building frameworks on top of Firebase, and I think the more Firebase continues to grow as a defacto database and auth/etc. solution, the more people/companies are going to be wrapping it, at least for internal use (but probably convenience frameworks at some point too). At the moment though I'm most interested in this Analytics topic. From what I can tell at first pass of the source (at least of FirebaseCore), Analytics being present is desired but not required. Is this actually/will this continue to be, the case?
Hi @mhuusko5. Google Analytics for Firebase is what enables us to offer an integrated experience across the various other Firebase services we offer. As such we try to make Firebase Analytics included in the default experience since this is will maximize the value to our users. A great example of this is the AdMob integration with Firebase. When used together, we are able to combine metrics from both AdMob and Analytics to answer more sophisticated questions like "On which screens are users being exposed to advertising the most or the least?" However, we know that some advanced users may explicitly only want the AdMob SDK which is why we avoid having hard dependencies. So yes, since this is by design, you can expect that we will continue to only be using weak dependencies for the majority of our inter-product integrations. There are other weak dependencies in the codebase as well, such as between Database and Auth, such that Database works without it, but when Auth is included in an app its functionality is enhanced. Hope that clarifies this.
@salqadri fantastic, thanks for the breakdown, and I love the design strategy. 👍
@mhuusko5 for the time being you can create frameworks wrapping Firebase for your own personal use by just embedding them in a target and using CocoaPods' inherit! :search_paths
without any issues. Life becomes much harder once you try to distribute the framework afterwards.
Distributing Analytics through Carthage shouldn't be too hard. For example, this is what mapbox does: https://www.mapbox.com/ios-sdk/
Relevant line in a consumer's cartfile would be binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 3.5
, which just points to a JSON file (https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json ) with version numbers and a URL from where to download the .framework
I understand that it will take some time to work through the bureaucracy that comes with being at Google, so I understand that adding complete Carthage support will potentially be a long-term goal 😄 Take your time, thank you for going (almost completely) open source ❤️
@AndrewSB for reference the issue here isn't Carthage, it's that we currently don't ship Analytics as a dynamic framework, which we must (should) before distributing it through Carthage.
Ahh, I see. Still a static framework, I take back what I said then. So I guess we're waiting on that dynamic framework then
Carthage has recently added some info to its README about integrating static frameworks that could be helpful - https://github.com/Carthage/Carthage#build-static-frameworks-to-speed-up-your-apps-launch-times
I create some dynamic frameworks compatible with carthage for my own projects with dependencies between them. It's not really complex. And if you want to create a cross-platform framework compatible with carthage you can follow this tutorial I created: Swift Cross Platform Framework 👍
+1
+1
+1
Still waiting for direct Carthage support.
+1
+1
Is there any progress?
This PR will be updated when there is progress.
Please don't add additional comments unless you are interested in contributing to the implementation.
Use :+1: to indicate interest.
+1
Not all of us are ok with CocoaPods molesting our project files. Stripe, Intercom, and Facebook all have beast SDK's and have Carthage support, and you're the ones supposed to be mobile dev friendly.
The manual setup is ridiculously insane and a huge barrier. The impression I get is you got something super legacy I wouldn't touch with a 10-foot pole.
How is this still an open issue? Is somebody actively working on it? Carthage 0.28 supports static binaries: https://github.com/Carthage/Carthage/releases/tag/0.28.0
+1 Analytics supports Carthage AFAIK https://github.com/segmentio/analytics-ios#carthage ?
FWIW I gave this a shot last week, I couldn't believe Google would just let it sit for years and I wanted it for a project I was working on. WIP over at my fork. I ran into a small snag: to vend firebase through Carthage, google-toolbox-for-mac also needs to support Carthage. I looked into setting that up too, but that project has some strange xcscheme settings I didn't feel like unmangling. WIP over at my fork of the toolbox.
@firebase-ops: I'd love some help upgrading google-toolbox-for-mac. Maybe you can ask some of the internal maintainers to work on this? If anyone else would like to contribute, please don't hesitate to target my forks, I'd be happy to merge anything that gets the project going with Carthage
@AndrewSB Thanks for digging in and glad to hear you're making progress, but I'm not sure it's currently possible with Carthage to support Firebase as the mix of source static frameworks currently required to work with the Analytics and InstanceID binary static framework dependencies.
I'm currently working on making a pure binary Firebase Carthage distribution derived from the Firebase zip distribution and planning to make it publicly available in the near future.
@paulb777 thats great to hear, that does seem like the complete solution. Keep us updated on how that's going. Like I mentioned last year, it should be as simple as creating a JSON file like https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json once the releases are uploaded in a standard way
An experimental binary Carthage Firebase distribution is now available including all of Firebase except Firestore and Invites. Details at https://github.com/firebase/firebase-ios-sdk/blob/master/Carthage.md.
I've also created a new github Carthage label for any specific issues or feedback.
I think this is just fine but can we expect Firestore support in near future?
@olejnjak Firestore has a dependency on gRPC which has resources and I couldn't figure out how to get the Carthage installer to install resources for a binary component. Any ideas?
@paulb777 are you talking about https://github.com/grpc/grpc? Can you be more specific with the resources that are required? Also, the folks over at Carthage are usually pretty helpful. If you aren't sure how to do this, creating an Issue there will probably get you an answer
@AndrewSB Specifically gRPC/etc/roots.pem from https://github.com/grpc/grpc.
I couldn't find a place to put it in the zip without being ignored by the Carthage installer.
The next time I have bandwidth for Carthage, I'll take another stab at it and make an issue. In the meantime, suggestions and contributions are welcome.
Thanks to @blender for help with Carthage binary resource installation.
We're seeing a linker warning when using Firebase with Carthage
ld: warning: Auto-Linking framework linker option at .../Carthage/Build/iOS/Firebase.framework/Firebase is not a dylib and not an archive
Any clue what's causing this? It still appears when Link frameworks automatically
is disabled.
@rerelease do you link empty Firebase.framework
? You shouldn't https://github.com/firebase/firebase-ios-sdk/blob/master/Carthage.md#carthage-usage
Delete Firebase.framework from the Link Binary With Libraries Build Phase.
Nope, already checked that. It's neither linked nor embedded with the app target.
It seems that replacing all import Firebase
statements with import FirebaseAnalytics
seems to get rid of the warning.
Having the same problem @rerelease, having the import Firebase
statement produces this warning.
Replacing with any other library works import FirebaseCore
for example or import FirebaseAnalytics
.
How to add this repository to Carthage? Only need paste that lines "binary ..." to the Cartfile?
How to add this repository to Carthage? Only need paste that lines "binary ..." to the Cartfile?
README : https://github.com/firebase/firebase-ios-sdk/blob/master/Carthage.md#carthage-usage
I already read, but what mean "create a subset"? I paste it to Carfile and testing now. Thanks.
@prsolucoes Does #1061 answer your question?
Yes. In my opinion, i think that something more clear as "paste de following lines into your Cartfile" will be easier to carthage newbies like me auhahuahuahuahua. But i understand that is paste lines and im testing now.
Hi,
After include this reps:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"
And carthage build, i have include the frameworks, but got error:
Invalid architecture: Could not read architectures from /Users/paulo/Developer/workspaces/xcode/xxx/Carthage/Build/iOS/FirebaseCoreDiagnostics.framework
Command /bin/sh failed with exit code 1
I've just deleted that framework, and all works well
I can ignore it? Remove it from my build and copy-framework?
Today im using all of this:
To use Analytics and Messaging parts.
We need someone of the contributors to confirm it is safe to remove FirebaseCoreDiagnostics.framework
I have removed it too, now its compile, but when i go install i receive this message on simulator and on device:
@kasyanov-ms @prsolucoes I deployed Firebase 4.12.0 to Carthage and fixed the FirebaseCoreDiagnostics error in the process.
I'm not able to reproduce the "This app could not be installed at this time." issue. If that's still occurring for you, please create another issue with details on how to reproduce.
Now that the Firebase SDKs are open source, can we then have Carthage support? 😍