-
Notifications
You must be signed in to change notification settings - Fork 984
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
Catalyst for ios platform ? #699
Comments
moved to cordova-ios repo |
Once it works, I think we'd want to encourage using Catalyst for macOS to avoid needing to maintain a similar-but-separate cordova-osx platform. See also #551. We'd definitely like to address this, but it's not clear if that code is actually being used (it probably is, by someone, somewhere) and whether removing it (like Ionic did) is the right step. |
It was removed in Capacitor, was not really being used there. Since it's in CDVURLProtocol.m and that won't work on WKWebView, I think it's safe to remove once we remove UIWebView. |
Unfortunately the maintainers are overloaded due to lack of resources, see apache/cordova#163. |
|
Have you tried to run the app in Catalyst after that change? |
Catalyst is only supported in Xcode 11 on macOS Catalina, so I'm not sure we'd want to enable it by default. |
From I am not sure what we say about macOS requirements. |
What happens if you add macOS target and then you open the project on Mojave? I updated both of my computers, so I can’t test anymore. |
Had a bit of time to play with the HelloCordova app in Catalyst tonight, and it doesn't work out of the box but it should be easy to make it compatible. Namely, we currently use a bash script to copy the config.xml and www folders into the root of the .app bundle. If we instead moved those to the Copy Bundle Resources step of the Xcode project, then it works. I don't know off-hand the historical reasons for not relying on Copy Bundle Resources, so there's probably some investigation to do there to see if this is a safe change to make. |
Sounds like we would need breaking changes to use the Copy Bundle resources and drop the AssetsLibrary, or am I mistaken on this? |
Random links/notes for whoever decides to investigate whether this is feasible:
|
@brodybits The ALAssetLibrary stuff (and all of CDVURLProtocol was dropped in 6.0) |
So just tested Catalyst for on a new 'hello' cordova project, using ios@6.1.0 Has someone gotten a Catalyst ios build to work ? |
CodeSign error means your app isn't signed properly, you need to select a development team in the target root node. The build fails for another reason |
I unfortunately have this same error. Cannot find a way around it. The app is set to automatically sign and a team is selected from both dropdowns. |
Yes, currently Cordova-iOS cannot generate successful builds with Catalyst. Catalyst is not supported. |
Is this still on sight for cordova-ios 7.0.0? @dpogue |
It's on our list of things we hope to do for v7.0.0, but there's nobody currently looking into it and no timeline |
if you guys can fix it that would be great, with the M1 being able to run "mobile" type of apps on a laptop would be awesome! |
That’s a separate thing, M1 is supposed to run iOS/iPadOS apps, catalyst creates macOS apps and works on any Mac. |
Hy guys With just a few changes, it is possible to generate a simple cordova app supporting catalyst without changing ios behavior
|
Do you know how it's possible to stop this from happening:
|
FirebaseAnalytics does not suport catalyst yet, but other frameworks do. I built a catalyst app with firebasemessaging successfully. Try update pods with latest version. |
The suggestion from @Leandropintogit didn't quite work for me (iMac M1, XCode 12.5.1)... While it enabled me to build the "My Mac (Designed for iPad)" configuration, it broke the "My Mac" and "My Mac (Rosetta) builds. After diffing the script outputs from the three available Mac configurations and looking for different environment variables, I found an EFFECTIVE_PLATFORM_NAME environment variable. Checking whether this is set to "-maccatalyst" seems to do the trick. At least it builds and runs in all three configurations. No idea if this is the official Apple way of distinguishing or not, but it seems promising. Relevant lines from the works-for-me copy-www-build-step.sh file:
Edit: this change does not appear to interfere with building for actual iOS. Seems to work for me on both the simulator and a physical phone. Edit 2: reset DST_DIR_WWW based on new DST_DIR. |
My understanding of the three configurations (which may not be fully accurate -- I've just started playing with this): Corrections welcome. |
@pulpgrinder I just a did a quick test on a M1 Mac and your code seems fine. It works for all Mac configurations for me. As this is a minimal change I would go for this. Would you like to create a pull request for this or can we take the code from the comment? Thank you for your comments and testing. This helped me to get it working. |
Long-term I'd like to see us move to using Xcode's "Copy Resources" step instead of a bash script, but for now it makes sense to fix the bash script if it's an easy change 👍 |
Good point. I tested the "Copy files" build setting in Xcode for a bit and it seems to work fine. I am not sure if the reasons for this script in the past are still strong enough to not change it. |
By all means use the code right from the comment, if that's convenient for you. It's such a small change that it hardly seems worth a PR. :-) |
* (refactor): move copy-www-build-step script to Xcode commands See #699 * select files to copy * copy config.xml from staging * feat: copy staging resources - Combined "Copy www" & "Copy config.xml" into "Copy Staging Resources" - Copy content from "Staging" group into Resources Co-authored-by: Erisu <erisu@apache.org>
…#1158) * (refactor): move copy-www-build-step script to Xcode commands See apache#699 * select files to copy * copy config.xml from staging * feat: copy staging resources - Combined "Copy www" & "Copy config.xml" into "Copy Staging Resources" - Copy content from "Staging" group into Resources Co-authored-by: Erisu <erisu@apache.org>
Hi
Has anyone tried building an ios project using 'Catalyst' for macOS Catalina ?
If I try enabling that build, I get:
CDVURLProtocol.m:20:9: AssetsLibrary is deprecated and is not available when building for Mac Catalyst. Consider migrating to Photos instead, or use
#if !TARGET_OS_MACCATALYST
to conditionally import this framework, first importing TargetConditionals.h if necessary.Seems like the AssetsLibrary has been deprecated, and has been fixed in ionic, are you guys planning on removing it too ?
ionic-team/capacitor#1825
Going forward, should Catalyst be used or the 'osx' platform ?
Thanks
The text was updated successfully, but these errors were encountered: