Xamarin iOS Release Build - Native linking failed

2.8k views Asked by At

I cannot build my Xamarin iOS project.

It works:

  • In debug mode with physical device
  • In debug mode with the emulator
  • In release mode with the emulator

But it won't work:

  • In release mode with physical device!

I tried:

  • All Linker Behaviors: No success
  • Deleting obj and bin folder and rebuilding: No success
  • Deleting Library/Caches/mtbs/builds/ and rebuilding: No success
  • Downgrading Visual Studio: No success
  • Adding --registrar:dynamic to mtouch arguments: No success

NuGet packages:

<PackageReference Include="Acr.UserDialogs" Version="7.1.0.483" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="TouchView" Version="4.1.100" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" />
<PackageReference Include="Xamarin.Essentials" Version="1.6.1" />
<PackageReference Include="Xamarin.Forms.InputKit" Version="3.7.2" />

Error:

Error MT5210: Native linking failed, undefined symbol: _EqualDomainSid. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaLookupSids. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _IsWellKnownSid. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _CreateWellKnownSid. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _ConvertStringSidToSidW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaOpenPolicy. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaLookupAuthenticationPackage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaClose. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _CloseHandle. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaFreeReturnBuffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaGetLogonSessionData. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetNamedSecurityInfoW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetTokenInformation. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _CheckTokenMembership. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _AllocateLocallyUniqueId. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _AdjustTokenPrivileges. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetCurrentThread. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetCurrentProcess. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _SetThreadToken. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _DuplicateHandle. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _OpenProcessToken. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegCloseKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegQueryValueExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetSecurityInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetSecurityDescriptorLength. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _FormatMessageW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RtlNtStatusToDosError. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _GetWindowsAccountDomainSid. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaConnectUntrusted. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _SetSecurityInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegEnumKeyExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaLogonUser. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _ConvertStringSecurityDescriptorToSecurityDescriptorW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegQueryInfoKeyW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RevertToSelf. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaLookupNames2. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LocalFree. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _OpenThreadToken. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LookupPrivilegeValue. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaFreeMemory. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LocalAlloc. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegSetValueExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _LsaDeregisterLogonProcess. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _ImpersonateLoggedOnUser. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegEnumValueW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegCreateKeyExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegDeleteValueW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _DuplicateTokenEx. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegDeleteKeyExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegOpenKeyExW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegConnectRegistryW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _RegFlushKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5210: Native linking failed, undefined symbol: _SetNamedSecurityInfoW. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. (MT5210) (MyXApp.iOS)
Error MT5202: Native linking failed. Please review the build log. (MT5202) (MyXApp.iOS)
/Users/miyazaki/Projects/MyXApp/MyXApp.iOS/clang: Error: linker command failed with exit code 1 (use -v to see invocation) (MyXApp.iOS)

Screenshots:

About Visual Studio

Project Options

Solution found thank @steven:

https://github.com/xamarin/xamarin-macios/issues/10884#issuecomment-803450479

0

There are 0 answers