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

[Xamarin.Forms] iOS build errors in Visual Studio for Windows #18

Open
gaelian opened this issue May 12, 2022 · 3 comments
Open

[Xamarin.Forms] iOS build errors in Visual Studio for Windows #18

gaelian opened this issue May 12, 2022 · 3 comments

Comments

@gaelian
Copy link

gaelian commented May 12, 2022

Using Visual Studio for Windows (17.1.6). Installed FSharp.Mobile.Templates then ran:

> mkdir TestXamApp
> cd TestXamApp
> dotnet new xf-fsharp

Then added the generated projects to a blank Visual Studio solution. I've successfully downloaded the required dependencies from NuGet and GitHub Packages by editing the nuget.config file to add the relevant authentication details. Building the Android and shared projects is successful, but the iOS project reports these build errors:

FSC : error FS1108: The type 'UIView' is required here and is unavailable. You must add a reference to assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
C:\Projects\TestXamApp\iOS\AppDelegate.fs(10,13): error FS0039: The type 'FormsApplicationDelegate' is not defined. Maybe you want one of the following:�   UIApplicationDelegate�   UIApplicationState�   IUIApplicationDelegate
C:\Projects\TestXamApp\iOS\AppDelegate.fs(12,19): error FS0855: No abstract or interface member was found that corresponds to this override

The latter error is referring to the FinishedLaunching override in AppDelegate.fs. Am I doing something wrong, or should this be working?

@TimLariviere
Copy link
Member

Disclaimer: .NET 6.0 mobile is not yet in a stable release, so all templates here are subject to breaking changes from Microsoft. Also while Xamarin.Forms on .NET 6.0 is technically feasible, I wouldn't recommend using it.
Microsoft made a breaking change deep in Xamarin.iOS that requires a recompiled version of Xamarin.Forms.

@TimLariviere
Copy link
Member

TimLariviere commented May 13, 2022

Not sure about UIView, but seems like you're missing the recompiled XF for .NET 6.
It comes from a GitHub packages feed. Can you confirm it restored Xamarin.Forms v5.0.0.1 and not another version?

@gaelian
Copy link
Author

gaelian commented May 16, 2022

Thanks for the reply @TimLariviere, I have double checked the projects in my test solution and while the shared and Android projects are using Xamarin.Forms 5.0.0.2337, the iOS project is using Xamarin.Forms 5.0.0.1. I didn't realise this recompiled package was only for iOS until you pointed this out.

While the package version seems to be correct for iOS, the same build errors persist:
Screen Shot 2022-05-16 at 7 41 21 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants