-
Notifications
You must be signed in to change notification settings - Fork 111
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
MacCatalyst support #471
Comments
Not sure yet how to deal with the native SQLite libraries. Do we need a special build, or does the iOS build or the macOS build work? |
Are there any news on this, or is there any workaround? |
No progress on this yet. I need to figure out how to compile the C code for maccatalyst. For example, the command line for iphone starts out like this:
And for macos:
I assume it's similar to these, but I haven't spent any time yet looking for the answer. |
Is there a documentation on how you did it for ios (end to end)? If not can you tell me on which code/ repo exactly you ran the above mentioned command? Would like to have a quick look myself, since I need SQLite in maccatalyst |
There are no docs, but my build scripts for the native SQLite libraries are over in the ericsink/cb repo. |
it seems to be working fine now: Important note: Run the app from Visual Studio. for some reason CLI doesn't work |
@VladislavAntonyuk I haven't looked closely at your samples yet, but just to be clear for anybody else seeing this -- there is currently nothing in SQLitePCLRaw and nothing in the I do plan to give this issue some real attention as soon as I can. |
@ericsink seems like Apple did a great job to make iOS code work on macOS with maccatalyst, But definitely waiting for your final release with official maccatalyst support. Thank you! |
Maybe so, but I thought I saw somewhere that things should be specifically compiled for maccatalyst. I need to confirm whether that's true. If something seems to work when the docs and specs say it should not, then I wonder why. And if something works when run from Visual Studio but not from the CLI, then it doesn't work. :-) |
I didn't investigate it, but probably VS restores packages differently and packs SQLite iOS lib in MacCatalyst. it's the only 1 idea that comes to my mind so far. |
@VladislavAntonyuk For me building in VS does not work at all, what version of VS are you using? Are you on an x86 or ARM machine? |
VS for mac 2022. Intel |
I always get the error Both my machines have VS2022 (latest), Xamarin.Mac (latest) and the latest maui-maccatalyst workload installed Do you have any special configuration on your system that might be related to this? |
Check XCode version. |
@VladislavAntonyuk Can you please share your diagnostic build log (especially the This is the error message I get: For RID @ericsink Thanks for hinting at the cb repo, I could slightly modify your script to build a MacCatalyst compatible version of Which repo is the base for the NuGet that will contain the maccatalyst support once you publish it? I would like to fork it and create a private NuGet for my CLI (agent) build, since I need EF Core to work on maccatalyst as soon as possible |
Thanks you, but this log does not contain the Also, please share the |
So from what I see it is important the iOS libs appear in maccatalyst folder, otherwise the app crashes and can't find e_sqlite3 |
Thanks for sharing the log files. From my understanding in order to be able to use the (iOS-)OS provided SQLite implementation, it would require some reference to it, for example by importing the SQLite header file into a referenced (native) library and actually using its methods. I would assume that But then I still don't get how this would work with MacCatalyst, since as far as I know MacCatalyst is not just emulating an iOS environment (like
On my end I got the app working using the CLI by doing the following steps:
The resulting |
as @ericsink mentioned this lib so far works only with net6.0-ios. SQLitePCL.raw/src/SQLitePCLRaw.bundle_e_sqlite3/SQLitePCLRaw.bundle_e_sqlite3.csproj Line 4 in 9d5a8b6
there is no net6.0-maccatalyst and net6.0-mac target frameworks |
For Catalyst it should do a fallback to For me it is working now using a privately published NuGet so I will use that approach going forward |
Could you already have a look into rebuilding the NuGet packages? |
@edoust I think what you said is sufficient. I've made those changes and pushed them up. However, the CI builds are currently failing for other reasons. It looks like something in the net6.0-ios SDK broke with this week's preview release. I am investigating. |
Looks like the problem is xamarin/xamarin-macios/issues/14434 |
Version 2.1.0-pre20220318192836 has been pushed up to nuget. It contains progress on maccatalyst support. I tried a very basic test and it seems to work. One caveat: I placed the native binaries under |
it works fine. I set TargetFramework to net6.0-maccatalyst and min version to 15.2 |
For me it does not work automatically, I need to add a NativeReference explicitly, or else the libe_sqlite.dylib is not put in the app package (I can only use test using the CLI, since VS2022 for mac preview 7 does not support .NET 6 Xamarin projects at the moment) |
Thanks. I had installed Xcode 13.3.0 and had to downgrade to 13.2.1 because of a bug in Xcode. Will try to update to Xcode 13.3.1. I am running on x64, so fingers crossed. |
@edoust, what command line did you use to install the maui preview workload? I used this one from the dotnet/maui wiki:
However this gives an error that the android sdk manifest is not found:
I couldn't find an open issue regarding this, and wondered if you ran into something similar. |
I use I use this custom nuget.config (rename to |
@edoust Thanks - what is the source of that nuget config? Perhaps I'll find more info there about installing the maui preview... |
use this guide to install it https://github.com/dotnet/maui/wiki/macOS-Install |
@edoust @VladislavAntonyuk Thanks guys, but I'm having no luck with installing either rc2 or rc4. Have you actually succeeded installing either maui rc2 or rc4? Specifically, the install halts at the first item (the android sdk) and says that it cannot find the mentioned version. I've tried this to install rc2 using the instructions at https://github.com/dotnet/maui/wiki/macOS-Install:
And then I tried replacing the rollback file with the url given by @edoust for rc4:
But neither work - it looks like the rollback file and the feeds must be mutually compatible, i.e. the feeds need to have items with the versions mentioned in the rollback file. Any ideas? |
I use rc2, because it is the latest released version. try to uninstall all workloads and install MAUI again |
@VladislavAntonyuk - could you please list the command line for installing maui rc2? |
@coolbluewater <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
<add key="xamarin" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/xamarin-impl/nuget/v3/index.json" />
<add key="public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="xx" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json"/>
<add key="xy" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-572aeedc/nuget/v3/index.json" />
<add key="xz" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
</packageSources>
</configuration> Then in the same directory of the nuget config execute the command |
@VladislavAntonyuk - that goes in a file named
|
Do you have dotnet 6.0.300 installed? can you check by running |
You can take a look how we install dotnet and Maui workload https://github.com/CommunityToolkit/Maui/blob/main/azure-pipelines.yml |
@VladislavAntonyuk @edoust - thanks! I had moved back and forth between runtimes and was on a different version. After installing 6.0.300 I was able to install maui rc4 using the above steps. |
@ericsink I built my app for maccatalyst15.4 (I think!), but still no sqlite love. Are you able to reproduce the failure? |
@coolbluewater Are you talking about above, where it works on the command line but not in the IDE? If so, no, I haven't found time to install VS for Mac and try it yet. |
I can just add that VS4Mac does not fully support MAUI. It will be added in 17.1. |
@VladislavAntonyuk - Yes, that's correct. Do we know whether sqlite works using Visual Studio for Windows, which fully supports maui? |
Just checked, it works on Windows. |
@VladislavAntonyuk - thanks! Which packages? Any special instructions to restore? VsMac keeps restoring packages a lot. Do you see the same behavior? |
I first run dotnet restore. Than open VS4MAC and run build. In that case VS4MAC doesn't restore packages again. Seems like VS treats iOS and Mac catalyst as the same target framework during package restore. Also it works on CI build because it uses dornet cli |
@VladislavAntonyuk thanks! Do you still need to change the os version for the maccatalyst target? |
yes, 15.2 is the minimum supported version |
Version 2.1.0 is on nuget. Any further maccatalyst-specific problems, please open a new issue. |
I am still having the exact same issue with |
No, I am doing a CLI build with this command - it does not change the problem whether I do it in VS or using dotnet
Will keep an eye on it, for now I am still using your preview package alongside the custom nuget that contains your native lib |
@edoust If you can construct a minimal repro project, please open a new issue and post it there. |
Yes, will do it these days |
the app works on iOS but crashes on maccatalyst
Originally posted by @VladislavAntonyuk in #468 (comment)
The text was updated successfully, but these errors were encountered: