Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Support for "iPad apps for Mac" aka Marzipan/Catalyst #3144

Closed
siburb opened this issue Jun 5, 2019 · 86 comments
Closed

FR: Support for "iPad apps for Mac" aka Marzipan/Catalyst #3144

siburb opened this issue Jun 5, 2019 · 86 comments
Labels
Catalyst macOS Issues or feature requests for macOS. type: feature request

Comments

@siburb
Copy link

siburb commented Jun 5, 2019

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 11
  • Firebase Component: All

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Attempting to build an iPad app for Mac, but it uses Firebase via Cocoapods, but we receive a lot of the following error:

Building for UIKit for Mac, but the linked framework '<frameworkName>.framework' was built for <unknown>. You may need to restrict the platforms for which this framework should be linked in the target editor.

Screen Shot 2019-06-06 at 11 09 06 am

Apparently, the Firebase binaries need to be built using Xcode 11 with the "Mac" option checked.

Relevant Code:

@ryanwilson
Copy link
Member

Thanks for the report, @siburb! There are some docs and sessions we need to catch up on in order to find out how to get this working for folks. We're working on it and will update this issue as we find out more :)

@paulb777
Copy link
Member

paulb777 commented Jun 5, 2019

And, as always, PRs are welcome!

@hajjD
Copy link

hajjD commented Jun 10, 2019

Any update on this? I would love my iPad / Mac apps to all run on FB back end.

@morganchen12
Copy link
Contributor

No update yet. In terms of infrastructure, adding Catalyst support would mean adding most of the support for AppKit apps as well. We're in the process of figuring that out and will have more to share soon.

@hajjD
Copy link

hajjD commented Jun 11, 2019

Are there any work arounds like building it for mac and the importing it into a project?

@morganchen12
Copy link
Contributor

Theoretically what you're describing should be possible, since Catalyst apps are built on macOS apps, but will only work for the existing macOS-compatible libraries and defeats the purpose of Catalyst (at that point you're just building an AppKit app). You could then create a bundle using Firebase and load it into your Catalyst app.

@guidedways
Copy link

guidedways commented Jun 12, 2019

I really hope it's not going to only work for Catalyst supported apps. We really need this to work for all macOS apps with or without Catalyst.

@morganchen12
Copy link
Contributor

AppKit support is also on our list of things to do. Fortunately, the Firebase website wouldn't need to distinguish between the two (i.e. console can display both as platform macOS), so much of the work is overlapping.

@appfrilans
Copy link

Is it possible to include firebase for macOS (UIKit for Mac) via pod 'FirebaseCore' ? I tried to make a separate target and set it in its own CocoaPods target (platform :macos, '10.15'), but importing via "import FirebaseCore" just gives me an error:

No such module 'FirebaseCore'

Any ideas? Or is this way impossible?

@ryanwilson
Copy link
Member

@appfrilans as far as I can tell, UIKit for Mac apps need an XCFramework instead of regular frameworks (please someone jump in and correct me if this is incorrect 🙂) - CocoaPods doesn't currently support that. I'm installing Catalina beta now on and hope to get XCFrameworks built for the open source pods that currently support macOS, I'll be updating this thread as I discover things (may not be until early next week that I'm successful, but I'll try to get something ASAP).

@morganchen12 morganchen12 added the macOS Issues or feature requests for macOS. label Jun 14, 2019
@morganchen12 morganchen12 changed the title FR: Support for "iPad apps for Mac" aka Marzipan FR: Support for "iPad apps for Mac" aka Marzipan/Catalyst Jun 14, 2019
@jonas-sleepcycle
Copy link

Here are someone who have gotten iOS frameworks working for UIKit for mac (not macOS though):

https://forums.developer.apple.com/message/362577

@ryanwilson
Copy link
Member

Thanks for the link, I tried a bunch last night but only ran into multiple errors with no real feedback, only an error message: The operation couldn’t be completed. (XCBCore.XCFrameworkValidationError error 8.).

To add a snippet of information from the above link, Catalyst frameworks must be built against the iOS SDK not the macOS SDK.

We're currently relying on CocoaPods for the framework build during our zip file as well, still trying to figure out the best way to build for the new platform. There's very little documentation on XCFrameworks and the tool doesn't provide much information on failures - but we're trying and will continue to try 😄

@hajjD
Copy link

hajjD commented Jun 18, 2019

Thanks for the link, I tried a bunch last night but only ran into multiple errors with no real feedback, only an error message: The operation couldn’t be completed. (XCBCore.XCFrameworkValidationError error 8.).

To add a snippet of information from the above link, Catalyst frameworks must be built against the iOS SDK not the macOS SDK.

We're currently relying on CocoaPods for the framework build during our zip file as well, still trying to figure out the best way to build for the new platform. There's very little documentation on XCFrameworks and the tool doesn't provide much information on failures - but we're trying and will continue to try 😄

Does the new Xcode Beta provide a better error or the same useless nondescript ones?

@ryanwilson
Copy link
Member

Does the new Xcode Beta provide a better error or the same useless nondescript ones?

Unfortunately this was last night with the new beta.

@ryanwilson
Copy link
Member

ryanwilson commented Jun 20, 2019

Good news: I was able to build some static x86_64 libraries that should work with UIKit for Mac apps.

Bad news: The way we currently package the frameworks with lipo fails since there are two libraries with the same architecture (simulator is also x86_64).

I'll try to use the -library and -headers parameters from xcodebuild -create-xcframework and see if I can package an XCFramework that works in a Catalyst app.

@dreampiggy
Copy link

as far as I can tell, UIKit for Mac apps need an XCFramework instead of regular frameworks (please someone jump in and correct me if this is incorrect 🙂)

Is this true ? I can build a normal UIKit for macOS with x86_64 architecture. The .xcframework is only one collection form of multiple individual .frameworks.

@girishw
Copy link

girishw commented Jul 3, 2019

Any updates on this? This would be critical for many apps.

@ryanwilson
Copy link
Member

ryanwilson commented Jul 4, 2019

Still working away, apologies for the radio silence.

I'll post when I can get something to work for FirebaseCore since that's what I'm starting with. I've been able to build a slice that works with UIKit for Mac, but currently am battling code-signing since it's now required for frameworks built for the new platform, as well as getting a module imported.

as far as I can tell, UIKit for Mac apps need an XCFramework instead of regular frameworks (please someone jump in and correct me if this is incorrect 🙂)

Is this true ? I can build a normal UIKit for macOS with x86_64 architecture. The .xcframework is only one collection form of multiple individual .frameworks.

Sorry for the confusion, I was thinking more from a distribution standpoint. Yes one can make a standard .framework that works with UIKit for Mac apps, but in order to have a "fat library" that is one .framework that works with all platforms we'd need to switch to .xcframeworks. It's either that, or ship multiple .frameworks for the same SDK and leave it up to the developer to add the ones with the right architecture to the right targets in their app - it's pretty messy and error-prone.

@ryanwilson
Copy link
Member

As a side note - if anyone has successfully taken a CocoaPod and built it to support both UIKit for Mac as well as iOS + simulator, please share any resources you can 😄

@filippozanfini
Copy link

Hi, has anyone taken a look at this solution? #583 (comment)

@ryanwilson

@ryanwilson
Copy link
Member

@kaleidscpe must have missed that, will take a look when I can.

Otherwise I have an xcframework for FirebaseCore, GoogleUtilities, and FirebaseStorage although I'm having some difficulties getting Storage working - there's a +load that's not getting called which causes the Storage instance returned to be nil.

This is the +load call:

Adding +ObjC to my linker flags did not work. Still investigating.

@ryanwilson
Copy link
Member

Turns out it was a silly project configuration error and I got it up and running. Once I verify things I'll probably create a GitHub release with the compiled XCFrameworks for testing purposes. Note: these will only be the open source frameworks to start (the ones available in this GitHub repo).

@jlubeck
Copy link

jlubeck commented Jul 10, 2019

@ryanwilson any chance you can share your findings with the GoogleMaps devs? Looks like the same error is also happening with that SDK, but I can't find a Github repo for GoogleMaps to create a ticket...

@bbrv2018
Copy link

Good afternoon, we are super happy that you will allow us to use Firebase for our iPad app on the Mac. Any idea when the new frameworks will be released? We had to abstract all our call to Firebase from our App to get it working at the moment.
Thank you very much!

@steipete
Copy link
Contributor

steipete commented Oct 9, 2019

We shipped our Catalyst app (PDF Viewer) and we're REALLY missing Firebase Crashlytics. Is there a rough ETA for it? Is there anything we can do to help/beta-test?

@peterstojanowski
Copy link

@samedson Is there any update or ETA on Firebase Crashlytics SDKs? I assume this will replace old Fabric Crashlytics and be compatible with Catalyst?

@samedson
Copy link
Contributor

Hey all, we are working towards providing this support - it's is a high priority for us. We'll let you know when there is news to share.

@guidedways
Copy link

@samedson thanks for the update! Can you please also confirm that Firebase support for macOS (i.e. non-Catalyst) is being looked into? We're receiving emails from Google to migrate our code but Firebase isn't fully supported, nor is there support for Analytics.

@samedson
Copy link
Contributor

Right now we have community support for macOS here: https://github.com/firebase/firebase-ios-sdk#macos-and-tvos. More fully fledged support is TBD.

You can currently get Crashlytics on macOS without Analytics by setting it up as an iOS app in the Firebase Console, and including the pods:

pod 'Crashlytics'
pod 'FirebaseCore'

@fishandphil
Copy link

Good afternoon.
We are trying to create the Firebase frameworks for our Catalyst App. Is it possible to have a bit more information about the following points:

  1. "FirebaseFirestore - Requires signing workaround for gRPC resource."
    What is the "workaround", were can we find information about what/how to do?

  2. When we do the last step: "Run it to build and test"
    What device should we do the "Build For Testing"?

  • "Generic iOS Device"
    or
  • "My Mac"?
    So far, we have been unable do build FirebaseCore on "My Mac" while it works fine on "Generic iOS Device". However, we were able to build FirebaseFirestore on "My Mac" which also build FirebaseCore I believe. Sadly, when integrating FirebaseFirestore for Catalyst in our project, we are getting about 30 "Undefined symbole" errors for grpc & leveldb.
    Unclear what we are doing wrong.

Thank you very much :)

@paulb777
Copy link
Member

@fishandphil

In general, you can search on the Catalyst tag in this Issues list, to get more Catalyst-specific status.

Here are the answers:

  1. See Invalid Code Signing for gRPCCertificates-Cpp.bundle in Mac Catalyst App #3500. I updated the comment above to clarify this. thanks!
  2. "My Mac". There is a known open issue for archiving Firestore (gRPC-Core file not found (Mac Catalyst) #4007), but we haven't seen any issues in development builds. If you're still having trouble with that, please open another issue with detailed repro instructions.

@girishw
Copy link

girishw commented Oct 17, 2019

@paulb777 Need some clarifications on the current state and build instructions :

  • Can I install using the currently released Cocoapods (eg Firebase/Core (6.10.0)) or do I need to generate the pods from GitHub source?
  • After generating the pods from Github, do I simply reference the local pods from my Podfile?
  • Currently, when building from the released Cocoapods I get the following error :

ld: in ..../Documents/ReSchedule/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(FIRConnectorUtils_77ff1e12be6740765c87f1be0d421683.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '.....Documents/ReSchedule/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector' for architecture x86_64

It looks like Firebase/Core (6.10.0) needs Firebase Analytics.

Thanks

@paulb777
Copy link
Member

@girishw

  • You can use the released CocoaPods
  • Use the pods just as you would for iOS
  • As discussed above, FirebaseAnalytics is binary and has no support yet for Catalyst. As you point out, Firebase/Core requires FirebaseAnalytics, so it cannot be in the Podfile. Separately, Firebase/Core is deprecated in favor of directly requesting the Firebase pods required.

@hajjD
Copy link

hajjD commented Oct 17, 2019

@paulb777
I assume same issue with Crashalytics? Also is there anywhere we can follow the progress on that.

@paulb777
Copy link
Member

@EliteTechnicalCare Only the comment above. Feel free to create another issue if you'd like to track Crashlytics for Catalyst specifically.

@Blackjacx
Copy link

Blackjacx commented Dec 11, 2019

This could be a game changer: CocoaPods/CocoaPods#9148 (XCFramework support in Cocoapods ✅)

@steipete
Copy link
Contributor

@Blackjacx We (PSPDFKit) did sponsor this particular CocoaPods feature. It will definitely make distribution easier in the future. It's not something that will help the Firebase team here, more additional work I would schedule after the initial support for Catalyst.

@ryanwilson
Copy link
Member

It's definitely helpful for zip builds of our open source SDKs - huge thanks @steipete for sponsoring this feature (on behalf of Firebase as well as the whole community)! There's still work to be done to get the closed source SDKs up and running with the internal build system.

@squm
Copy link

squm commented Dec 19, 2019

What is the current status, where I can check the progress on all this, not bothering anyone here at the issues ?

@paulb777
Copy link
Member

@squm Good point, thanks! I updated the repo's README today with a summary of the current state of Catalyst support.

I'm going to close this umbrella issue in favor of more specific questions and issues. Please check existing Catalyst issues and create new issues for additional issues and questions.

@girishw
Copy link

girishw commented Dec 19, 2019

@paulb777 I am using GoogleSignIn with FirebaseAuth. Where does that fall in all this?

@paulb777
Copy link
Member

GoogleSignIn is mostly out of scope for us here, but it's a binary CocoaPod so Catalyst support would require more work. Probably best to follow up directly on one of the GoogleSignIn channels.

@pangia
Copy link

pangia commented Dec 19, 2019

I don't see firebase analytics/crashlytics listed in the README. Are these not "supported" yet?

@girishw
Copy link

girishw commented Dec 19, 2019 via email

@paulb777
Copy link
Member

@pangia Follow #4316 for Crashlytics
@girishw I gave a Google-internal bump to the GSI team

@kajensen
Copy link

Added tickets for Catalyst support for Analytics (#4563) and RemoteConfig (#4564)

@girishw
Copy link

girishw commented Dec 30, 2019

@paulb777 To integrate GoogleSignIn with Firebase Authentication on MacOS, can I use GTMAppAuth (https://github.com/google/GTMAppAuth) with the signIn(withCustomToken:completion:) method?

Is there someplace else I should be asking this question?

@paulb777
Copy link
Member

@girishw It's best to open a separate issue to more easily track and assign the question.

@firebase firebase locked and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Catalyst macOS Issues or feature requests for macOS. type: feature request
Projects
None yet
Development

No branches or pull requests