-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Build fails when targeting Mac (Project Catalyst) #2698
Comments
Wow, I just read the related issues. This looks like it's nowhere near ready at the "underlying SDK support" or react-native level. PRs welcome? |
First step is getting the build to work, hopefully there won't be much to change on react-native-firebase itself, mostly on the underlying sdk that is already being worked on. They merged a lot of related prs.
I recall seeing tweets of people that made it work for basic apps, don't know about complex apps.
I'm trying to get build to work by commenting stuff (😄), but I don't have native experience to really help. |
Interesting, I think we can swap out that PHAsset API out with something more compatible, what that is yet I'm not sure. That or add a macro condition for Catalyst specifically to use a different API. But ye, the main chunk of work will be external to this project and in RN & Firebase iOS SDK. |
About the "react-native level", I got my app to run and 99% of the things are working as expected. I only had to remove Firebase and disable the WebSocket module for it to work. Didn't need to make code changes or remove any other native dependencies like Tweeted a more complete video here: twitter.com/brunolemos/status/1185636022346043392 |
"disable the websocket module" -> what are the impacts of that, is that metro-bundler specific and imply that the standard fast refresh dev cycle does not work? Looks promising |
Development mode doesn't work at all because of that. So that is super annoying but since the app is basically the same as the iPad app you can run the iPad one on development mode and check the mac one on release mode for now. |
Looks like if you comment out the one line failing the build in this module, then do this workaround firebase/firebase-ios-sdk#3500 (comment) you could actually have firebase working |
Haven't tried this yet but I don't think so because the errors I got weren't related to signing |
@brunolemos if there's anything we can look at for this let us know, I'm not sure yet what the scope is of this not working, whether it's down to our implementation in RNFirebase or the Firebase iOS SDKs themselves. If it helps btw, you can swap out the Firebase iOS SDK versions quite easily now in your Podfile if you need to try newer versions to see if there's been improvements in support, see the iOS section of: https://invertase.io/oss/react-native-firebase/guides/overriding-native-sdk-versions |
React Native has fixed the WebSocket/Development issue, it's on master: facebook/react-native#27469 We still need to wait for the firebase sdk support firebase/firebase-ios-sdk#3144. react-native-firebase still needs to replace fetchAssetsWithALAssetURLs as well. |
I wonder if this means it’s possible to build for Catalyst: https://github.com/firebase/firebase-ios-sdk/pull/4532/files |
Looks like admob, analytics, crashlytics, inAppMessaging, MLKit and Performance are still off-limits for catalyst, but the rest yeah |
Is there ANY positive update/light in the tunnel/perspective for next few months? |
@Salakar as far as I know, iOS SDK is now supporting Mac basing on their release notes (https://firebase.google.com/support/release-notes/ios), also - in last React Native update (0.62.0) has resolved issues related to Sockets, so it's possible to build for Mac - facebook/react-native#27469 So I think labels of this issue (blocked) are not relevant anymore. |
@Salakar It's my 3rd 'spam' reply on this issue. While I understand it might be very hard to resolve, it's quite important as it impacts root decisions related to choosing libraries for react native project if you plan to support MacOS. Lack of any (yes/no/maybe/dont know) response on this topic is very confusing. Also seems it's not included in any kind of roadmap. I've tried to sit down with my friend iOS developer, and we've managed to 'comment out' most of the issues as a lot of them were related to Photos Library, assets library etc. We didn't manage to build analytics as they seemed to be included even if I removed analytics pod, as this pod is included in firebase core. |
This was the last reply from @Salakar
So, "the main chunk of work" appears to be done. That leaves the RNFB part which would likely be "swap out that PHAsset API out with something more compatible" or "add a macro condition for Catalyst specifically" to use a different API, or (to avoid false dichotomy) perhaps something we aren't thinking of yet. I imagine that could go mainline though if there was a PR. @pie6k have you examined available Catalyst APIs that could replace the unavailable PHAsset one to see what the universe of alternatives is? Have you tried one? That would be the next step - a PR that proposes exactly how to handle the straddle across the platform. And that might be all there is to it |
That does seem to be the case. My project only uses /firestore and /functions, but I was able to get it running without issue after disabling the deprecated PHAsset fetch. |
|
Those APIs are deprecated and have been for several years. They represent a way to access assets via an older URL representation. Clients using those old-style URLs will need to migrate to the newer style URLs. The ReactNative sources using the older PHAsset APIs should throw in those branches |
Wow, you're not wrong: https://developer.apple.com/documentation/photokit/phasset/1624782-fetchassets
And the other option we use is available since iOS8 @Salakar I think this was possibly deprecated 3 years ago when you first coded it: https://github.com/invertase/react-native-firebase/blame/v2.x.x/ios/RNFirebase/storage/RNFirebaseStorage.m#L257 Seems like maybe anything @andymatuschak if you proposed anything like that it seems sensible to me though Mike D might know more |
The Catalyst SDK does not support `assets-library://` URLs, which have been deprecated for many years. This patch fixes the build failure when compiling with the Catalyst SDK; requests for such assets will fail and log (the first time).
Issue
macOS Catalina was released today to the public after some months of betas. The new Xcode adds a target option "Mac" in addition to "iOS" and "iPad":
When enabling it, there's at least one build error coming from
react-native-firebase
.react-native-firebase/packages/app/ios/RNFBApp/RNFBUtilsModule.m
Line 63 in 16e67dd
If you comment that line, the next error comes from the underlying ios firebase sdk.
So there are a few things to fix on this repo and others that we'll have to wait (or contribute to) the underlying sdk.
Dependent on firebase/firebase-ios-sdk#3144
Related: react-native-community/discussions-and-proposals#131
Project Files
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native v0.60.2
react-native-firebase
version you're using that has this issue:6.0.0
Firebase
module(s) you're using that has the issue:app
,analytics
TypeScript
?Y
The text was updated successfully, but these errors were encountered: