I am getting below linker errors upon build in an Xamrain Forms iOS project. I have tried from both a Visual Studio for Mac and from Visual Studio Windows paired with a Mac.
I have referenced as many Xamarin.Firebase.iOS.* assemblies as I can see as relevant but no luck.
What am I doing wrong?
Thanks
Regards
Native linking failed, undefined symbol: _GULLogWarning. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_encode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined Objective-C class: GULNetwork. The symbol '_OBJC_CLASS_$_GULNetwork' could not be found in any of the libraries or frameworks linked with your application.
Native linking failed, undefined symbol: _GULLogBasic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
] in GoogleAppMeasurement(APMMeasurement.o)
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusOK. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_encode_submessage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotFound. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_encode_string. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeCannotAcceptTraffic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined Objective-C class: GULAppEnvironmentUtil. The symbol '_OBJC_CLASS_$_GULAppEnvironmentUtil' could not be found in any of the libraries or frameworks linked with your application.
Native linking failed, undefined symbol: _GULSetLoggerLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_ostream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
] in GoogleAppMeasurement(APMMeasurement.o)
Native linking failed, undefined Objective-C class: GULMutableDictionary. The symbol '_OBJC_CLASS_$_GULMutableDictionary' could not be found in any of the libraries or frameworks linked with your application.
Native linking failed, undefined Objective-C class: GULAppDelegateSwizzler. The symbol '_OBJC_CLASS_$_GULAppDelegateSwizzler' could not be found in any of the libraries or frameworks linked with your application.
Native linking failed, undefined symbol: _pb_istream_from_buffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_read. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeUnavailable. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
] in GoogleAppMeasurement(APMMeasurement.o)
Native linking failed, undefined Objective-C class: GULSwizzler. The symbol '_OBJC_CLASS_$_GULSwizzler' could not be found in any of the libraries or frameworks linked with your application.
Native linking failed, undefined symbol: _pb_decode_varint. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _GULIsLoggableLevel. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_encode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC -lc++ -lsqlite3 -lz
Native linking failed, undefined symbol: _pb_decode. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _GULLog. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _pb_encode_tag_for_field. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusNoContent. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
] in GoogleAppMeasurement(APMMeasurement.o)
linker command failed with exit code 1 (use -v to see invocation)
Native linking failed, undefined symbol: _GULLogInfo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Native linking failed, undefined symbol: _kGULNetworkHTTPStatusCodeNotModified. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Related
In my project add package for video call
#zoom/react-native-videosdk
I have followed their documentation and installed SDK for ios. but when running the build from Xcode gets the following error.
enter image description here
Errors:
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKSessionContext
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKVideoOptions
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKAudioOptions
Undefined symbol: OBJC_CLASS$_ZoomVideoSDK
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKInitParams
Add framework in Link binary with libraries
Add in embed frameworks
in build setting setup Other Linker Flags with -all_load
pod delete reinstall, rebuild
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
My Xamarion.iOS binding project has the links to all the required native video SDK libraries and native OS frameworks. I have set the required frameworks using Frameworks attribute. Other settings include SmartLink=true, ForceLoad=true, IsCxx=true, LinkerFlags="-lc++". It can be built into a C# DLL. In iOS project, the DLL is referenced and used. However there are native linking errors.
MTOUCH: Error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_M_destroy(std::allocator<char> const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
The details in build log:
> Undefined symbols for architecture arm64:
> "std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
> HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
> HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
> "std::string::_Rep::_S_empty_rep_storage", referenced from:
> HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
> HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
> "std::string::assign(char const*, unsigned long)", referenced from:
> HPR_UTF82A(char const*) in libHCCore.a(HPR_Utils.o)
> HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
> "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char>
> const&)", referenced from:
> HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
> "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced
> from:
> HPR_A2UTF8(char const*) in libHCCore.a(HPR_Utils.o)
> ld: symbol(s) not found for architecture arm64
> clang : error : linker command failed with exit code 1 (use -v to see invocation)
The wrap errors:
MTOUCH: Warning MT5215: References to 'System' might require additional -framework=XXX or -lXXX instructions to the native linker (MT5215)
Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC (MT5201)
MTOUCH: Error MT5202: Native linking failed. Please review the build log. (MT5202)
clang: Error: linker command failed with exit code 1 (use -v to see invocation)
Please shed light. Thanks.
No such native linking error in Xcode. The build settings:
Managed linking and native linking may remove code. Link All may remove more code. So need to solve the problem instead of making the issues disappear using Link All. When using Link All, need to use Preserve attribute to preserve code.
I added all native references, set the linking options correctly. Also I set the linker flags to include all the required OS platform frameworks correctly. After adding reference to a native dynamic framework, the error disappeared. Then instead of getting undefined symbols, I got duplicate symbols. I had to remove a reference to a native library.
Although the iOS project is linked and built after referencing dynamic frameworks, there is a runtime issue. Our SDK provider confirmed that we must not use their dynamic frameworks. The dynamic frameworks are provided for other customers for a different target SimpleDemo_Dy in Xcode. They are older versions SDK. We should just use the static libraries.
I have re-examined the Xcode build log. No dynamic frameworks are used for target SimpleDemo in Xcode. The question is why Xcode project builds without using any dynamic frameworks, but Visual Studio for Mac build fails with a native linking error?
I’ve created a sample iOS app which only uses static libraries. It builds and runs OK. I've shared the sample iOS app with you. The link is https://drive.google.com/file/d/10QXkaZE7lURN6IF96NIrTGY2lmn88ctF/view?usp=sharing.
I haven’t been able to achieve the same in our product app with identical binding project settings. I even tried to swap the binding project from the sample app. It didn't help. Also I compared the iOS project settings from project options UI and WinMerge. I still couldn't find what's wrong. I have tried clean and rebuild many times. I have tried to check out to a fresh workspace. It still has undefined symbol error.
I think the issue is one of the native libraries libHCCore.a is compiled with libstdc++ which caused the error undefined symbol std::string while the rest are libc++.
Adding Linker Flags -lstdc++ to the native reference didn't help. How to used additional Mtouch arguments in iOS project or additional btouch arguments in binding project to resolve the issue?
See https://github.com/xamarin/xamarin-macios/issues/8669.
We understand that the issue with our iOS app is caused by the mix of libstdc++ and libc++ libraries of our vendor's SDK. Their libHCCore.a was compiled with libstdc++ while all the rest were compiled with libc++. I have tried additional linking options in Visual Studio for Mac, but failed with “libstdc++ is deprecated” and “Library –lstdc++ is not found”. Here is Microsoft Sebastien Pouliot's advice:
I think the issue is one of the native libraries libHCCore.a is compiled with libstdc++ which caused the error undefined symbol std::string while the rest are libc++.
You can't mix both.
Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of macOS 10.9 or later, or iOS 7 or later.
...
Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++.
https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes?language=objc
You'll need to talk with your vendor to get an updated that is built against libc++
Please rebuild libHCCore.a with libc++.
This issue has been resolved by rebuilding libHCCore.a with libc++ through our vendor.
Every time I'm trying to debug my Xamarin.iOS app on a device I'm getting the following error
MTOUCHTASK: error MT5210: Native linking failed, undefined symbol: _dispose_managed_object. Please verify that all the necessary frameworks have been referenced and native libraries are properly
linked in.
MTOUCHTASK: error MT5202: Native linking failed. Please review the build log.
Deploy/Debug on an emulator works fine.
My build settings are the following:
Change your LinkWith attribute to:
[assembly: LinkWith (..., ForceLoad = false, SmartLink = true)]
I am trying to use the objective-git library for an ios application I am in the proccess of developing. I am able to get the library to compile, link, and run perfectly fine in the simulator. However, when I try to run the application on an actual iPad, I get the followign error:
Undefined symbols for architecture armv7s:
"_libiconv", referenced from:
_git_path_iconv in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_close", referenced from:
_git_path_iconv_clear in libObjectiveGit-iOS.a(path.c.o)
"_libiconv_open", referenced from:
_git_path_iconv_init_precompose in libObjectiveGit-iOS.a(path.c.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I believe the issue is that I am compiling the libgit2 library with a different version of iconv then the one included with ios. However, I have messed with the build script in an attempt to force it to link with the ios version, but the error persists. How should I go about properly linking the iconv library so that I can run the application on an actual device?
You need to add libiconv.tbd to 'Link Binary With Libraries' section in Build Phases.
Note: I know ObjectiveGit fixed this issue but maybe that helps to others those who are trying to use iconv in their projects.