10

Not able to run Xamarin iOS project after Visual studio update.

Because updated IDE requires the latest Xcode (iOS 13.4 SDK shipped with Xcode 11.4)

Environment Details

  • OS Version : macOS Mojave, OS X 10.14.6
  • IDE : Visual Studio Community 2019 for Mac Version 8.5.1 (build 42)
  • Xamarin.iOS Version: 13.16.0.11 (Visual Studio Community)
  • Xamarin.Mac Version: 6.16.0.11 (Visual Studio Community)
  • Xcode Version 13.2

What I tried.

Instead of updating the Xcode, I simply changed the Linker Behaviour to Link Framework SDKs Only.

No luck, I got the following errors.

Error MT5210: Native linking failed, undefined symbol: ___darwin_check_fd_set_overflow. 
Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210)

Error MT5202: Native linking failed. Please review the build log. (MT5202)

Error: linker command failed with exit code 1 (use -v to see invocation)

Reference.

Is there any other option to resolve the issue without update the Xcode and macOS?

Any help will be really appreciated.

Thank you

Federico Navarrete
  • 3,069
  • 5
  • 41
  • 76
Mable John
  • 4,518
  • 3
  • 22
  • 35
  • 1
    Can you try with a lower Xamarin.iOS Version? – nevermore Apr 08 '20 at 02:12
  • Can you please mark the answer I added so that we can help more people with same problem:). – nevermore Apr 08 '20 at 05:42
  • I had the same problem recently and wasn't able to solve it (I cant upgrade xcode...). What I noticed is that in the build log it says that the files that require the offending symbol are related to debugging. Lo and behold, the project builds and runs in release mode :D. So it's possible that this is a bug on the VS side and maybe it will get fixed. – bor Apr 14 '20 at 19:03
  • Can you please mark the right answer which will help more people with same problem:). – nevermore May 05 '20 at 02:30

3 Answers3

5

Cause : Latest visual studio requires latest Xcode (iOS 13.4 SDK shipped with Xcode 11.4)

To solve the issue install the latest Xcode or use a lower Xamarin.iOS Version

 if you are on a mac, you might be able to find the previous installer here:

~/Library/Caches/VisualStudio/[Replace with Visual Studio Version]/TempDownload

or, if you know the version of the previous version of ios, you can download it from here (change the version number to suite your needs:

https://dl.xamarin.com/MonoTouch/Mac/xamarin.ios-13.14.1.39.pkg.

Xamarin/xamarin-macios Releases, which contains every version

if you are on windows, this post might give you some clues on where to find the local cache instead: https://montemagno.com/cleanup-up-space-xamarin-dev-machine/

For more details: Ans-1 | Ans-2

Mable John
  • 4,518
  • 3
  • 22
  • 35
  • Downloading and installing the xamarin.ios-13.14.1.39.pkg on my mac fixed this for me, tho I did have to restart visual studio for windows and re-pair with the mac to get vs4w to realise it had changed. – wislon Apr 18 '20 at 03:04
4

The latest version of Visual-Studio use the latest version of Xamarin.iOS which may not work with the lower version of Xcode .

So use a lower Xamarin.iOS Version would solve this problem.

nevermore
  • 15,432
  • 1
  • 12
  • 30
  • Is there a place where we can download older versions of VS or Xamarin.iOS? I was able to go 1 version back on the VS download page but not further. – bor Apr 14 '20 at 19:07
  • How can we lower the Xamarin.ios version – Anand Apr 15 '20 at 16:59
  • 1
    Check my answer in [this question](https://stackoverflow.com/questions/61237360/xamarin-ios-app-native-linking-failed-after-updating-vs-2019/61243317#61243317). – nevermore Apr 16 '20 at 05:35
0

It looks like Apple have broken usage of -no_weak_imports with a recent XCode (see https://github.com/mono/mono/issues/19393#issuecomment-606852342 and https://github.com/mono/mono/issues/19393#issuecomment-607126761 ). Upstream Mono appears to have worked around the issue with https://github.com/dotnet/runtime/pull/36436 ) but one wonders why Apple introduced a hard dependency on a weak symbol in their system libraries while still providing the option to disable weak symbols...

Anon
  • 6,306
  • 2
  • 38
  • 56