Xamarin iOS build error - Native linking failed (Link Framework SDKs Only)

6.7k views Asked by At

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

3

There are 3 answers

3
nevermore On BEST ANSWER

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.

1
Mable John On

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

0
Anon On

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...