Cannot build Xamarin.iOS with Microsoft Solver Foundation - xamarin

I've added Microsoft Solver Foundation via Nuget to a Xamarin iOS project but it fails to build with this message:
Build FAILED.
MTOUCH : warning MT5215: References to 'gdiplus' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'gdi32' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'user32' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'libX11' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'winspool' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'libcups' might require additional -framework=XXX or -lXXX instructions to the native linker
MTOUCH : warning MT5215: References to 'kernel32' might require additional -framework=XXX or -lXXX instructions to the native linker
clang : error : linker command failed with exit code 1 (use -v to see invocation)
error MT5209 : Native linking error : framework not found Carbon
MTOUCH : error MT5202: Native linking failed. Please review the build log.
7 Warning(s)
3 Error(s)
I'm just starting out with Xamarin and I haven't seen these issues before. Does anyone know how I can fix them?
Here's a screenshot

I'm not sure if Mircosoft Solver has been updated recently, but my understanding is that it's internal reliance on Linq assemblies meant that it didn't work with the MonoFramework properly.
I've not seen any reference to anyone that's successfully linked the assemblies correctly. I'm not entirely sure if Solver can actually be linked with Xamarin at the moment.
looking at your exception logs above it's pushing the assembly build to the native linker, and it's hitting exceptions with certain dlls. In most native linker cases you would have to wait for the xamarin team to push out an update. But I don't think Solver Foundation is on their list.
Example of native linker bugs

Related

Native linking failed

i am try to compile my xamarin.ios in release build. i use 'Link SDK assemblies only' with some additional mtouch arguments '-cxx' and '-gcc_flags' to link library,but get the following errors:
MTOUCH : error MT5210: Native linking failed, undefined symbol: _kUTTagClassFilenameExtension. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _UTTypeCreatePreferredIdentifierForTag. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _kUTTypeBundle. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _UTTypeConformsTo. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioComponentFindNext. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioComponentInstanceNew. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioUnitUninitialize. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioUnitSetProperty. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioOutputUnitStop. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioUnitRender. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioUnitInitialize. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioConverterNew. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioConverterFillComplexBuffer. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioOutputUnitStart. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _kUTTypeTIFF. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioComponentInstanceDispose. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _AudioServicesPlayAlertSound. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
I have tried different configuration for ios build setting:
'link sdk assemblies only' in release mode but get same errors
'link sdk assemblies only' in debug mode but get same errors
'link all assemblies' in release mode but get same errors
'link all assemblies' in debug mode but get same errors
'no link' in release mode, it install on my phone but my app quit unexpectedly as long as i open it.
'no link' in debug mode, everything is ok and i can run my app on my phone
i cannot find any useful information about these errors. could anyone help me?
You could check Additional mtouch arguments in iOS Build to ensure if all frameworks are properly linked in.
Check your Xamarin.iOS project Linker

Xamarin iOS Firebase Native linking failed

After updating the Firebase libraries, I'm getting the following errors:
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMAnalyticsConfiguration. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
Blockquote
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMAppMeasurementOriginFirebase. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMIsAnalyticsCollectionDeactivated. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMIsAnalyticsCollectionEnabled. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMMonitorLogTagOptionKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH : error MT5210: Native linking failed, undefined symbol: _APMSafelistedEventsOptionKey. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
I've tried the following:
Deleting obj and bin folders
Cleaning the project
Initializing Firebase core (Firebase.Core.App.Configure();)
I've tried all linker behavior options.
I'm referencing the following Firebase libraries:
Xamarin.Firebase.iOS.Analytics (6.4.1)
Xamarin.Firebase.iOS.CloudMessaging (4.3.0)
Xamarin.Firebase.iOS.Core (6.6.6)
Xamarin.Firebase.iOS.DynamicLinks (4.0.8)
Xamarin.Firebase.iOS.Installations (1.1.1)
Xamarin.Firebase.iOS.InstanceId (4.3.3)
Does anyone know how to solve this?
Unfortunately, there isn't much that you can do in this case. The error is related to incorrect linking. The guys from Xamarin have messed up the bindings after one of the upgrades. You can read more about using native libraries in Xamarin here & more specifically here.
However, you can still do something to help - isolate which package caused the issue and from which version onwards it happens. Then, report it at the official GitHub repository for Google APIs here.
P.S. I have gone through the issues and haven't seen this exact list of errors. There have been (and still are) a lot of binding issues, which are waiting to be fixed. So, in order to speed things up, discuss it with the devs from the issue and hopefully, they will be able to resolve it quickly.

Not able to make archive ios app for publish

I have used the latest visual studio(8.3) and Xcode 11 in mac.
I am able to run my project on both configurations​ like debug and release.
but when try to archive ios app for making IPA it failed...for archiving it's taking 1+ hr and at the end, it fails.
Logs
MTOUCH : error MT5210: Native linking failed, undefined symbol:
_Xamarin_iOS_MapKit_MKDirectionsResponse__ctor_intptr. Please verify that all the necessary frameworks have been referenced and native
libraries are properly linked in. MTOUCH : error MT5210: Native
linking failed, undefined symbol:
_Xamarin_iOS_MapKit_MKDirectionsResponse_get_ClassHandle. Please verify that all the necessary frameworks have been referenced and
native libraries are properly linked in. MTOUCH : error MT5210: Native
linking failed, undefined symbol:
_Xamarin_iOS_MapKit_MKDirectionsResponse_get_Routes. Please verify that all the necessary frameworks have been referenced and native
libraries are properly linked in. MTOUCH : error MT5210: Native
linking failed, undefined symbol:
_Xamarin_iOS_MapKit_MKDirections_CalculateDirections_MapKit_MKDirectionsHandler.
Please verify that all the necessary frameworks have been referenced
and native libraries are properly linked in. MTOUCH : error MT5210:
Native linking failed, undefined symbol:
_Xamarin_iOS_MapKit_MKDirections__cctor. Please verify that all the necessary frameworks have been referenced and native libraries are
properly linked in.
this type of 66454 Error(s) I am getting.
please help me.
Try just building the application then the .ipa file will be in bin\Iphone\release

MMP : error MM5109: Native linking failed with error code 1. Check build log for details

I am creating Binding DLL for Xamarin.Mac using the Binding project in visual studio Mac.
I am able to build Binding DLL successfully, However while going to use that binding DLL in Xamarin.Mac project then it returns bellow error.
MMP : error MM5109: Native linking failed with error code 1. Check build log for details.
Error Detail :
Building: CompatibleToXamarinForms.Mac (Release|iPhone) Build started
23-10-2018 17:16:33.
Project
"/Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/CompatibleToXamarinForms.Mac.csproj"
(Build target(s)):
Target _CoreCompileImageAssets:
Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices
--output-format xml1 --output-partial-info-plist
...
"___gxx_personality_v0", referenced from:
-[AgoraLiveTranscoding init] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
-[AgoraLiveInjectStreamConfig init] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
-[AgoraPublisherConfiguration toJsonString] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
agora::rtc::RtcEngineEventHandlerIosImpl::onMediaEngineLoadSuccess()
in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
____ZN5agora3rtc28RtcEngineEventHandlerIosImpl24onMediaEngineLoadSuccessEv_block_invoke
in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
agora::rtc::RtcEngineEventHandlerIosImpl::onMediaEngineStartCallSuccess()
in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
____ZN5agora3rtc28RtcEngineEventHandlerIosImpl29onMediaEngineStartCallSuccessEv_block_invoke
in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o)
...
ld: symbol(s) not found for architecture x86_64
clang : error : linker command failed with exit code 1 (use -v to see invocation)
MMP : error MM5109: Native linking failed with error code 1. Check build log for details. Done building target "_CompileToNative"
in project "CompatibleToXamarinForms.Mac.csproj" -- FAILED.
Done building project "CompatibleToXamarinForms.Mac.csproj" -- FAILED.
Build FAILED.
/Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/obj/iPhone/Release/mmp-cache/registrar.m(36313,17):
warning G7AC58F0F: method 'deviceBrowserView:selectionDidChange:' in
protocol 'IKDeviceBrowserViewDelegate' not implemented [-Wprotocol]
/Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/obj/iPhone/Release/mmp-cache/registrar.m(39971,2):
warning GB7F1753F: method possibly missing a [super
splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:] call
[-Wobjc-missing-super-calls] clang : error : linker command failed
with exit code 1 (use -v to see invocation) MMP : error MM5109: Native
linking failed with error code 1. Check build log for details.
2 Warning(s)
2 Error(s)
Time Elapsed 00:00:22.65
---------------------- Done ----------------------
Build: 2 errors, 2 warnings
Can you please someone help to resolve this issue.
Couple of things which I found from the above error
You are trying to select iPhone for xamarin.mac project which is not a correct binding. Might be you have created a binding project supported for mac and you are trying to build with iPhone configuration or the other way.
Did you select the same architecture while building the binding library (say the .a file) in xcode which is same as that of your xamarin iOS project?
check these both, you will get the answer.
From the error log it looks like you're missing some frameworks or libraries that your native library needs to function.
If that is a Agora MacOS SDK (AgoraRtcEngineKit.framework) it would need several frameworks and libraries added as linker flags.
Frameworks:
CoreMedia
CoreAudio
SystemConfiguration
QTKit
CoreWLAN
Foundation
AVFoundation
VideoToolbox
AudioToolbox
IOKit
Libraries:
libresolv
libc++
How do I know?
Usually, native libraries provide sample applications and this is where you can see which frameworks and libraries are required:
To be sure, please go to Visual Studio For Mac 2017 preferences and set the build log verbosity to diagnostic and post the failed build log to gist.github.com

In release build getting MTOUCH : error MT5213: Duplicate symbol

Our Xamarin.iOS release build is failing with MTOUCH : error MT5213: Duplicate symbol. This error started happening recently and is likely due to a nuget package somewhere but the funny thing is none of those APIs look familiar at all. I've tried investigating the source but can't find where they're getting included.
I've tried.
1. Downgrading Xamarin forms from latest version to the last point version 2.5xxxx
2. Removing all nuget packages added since our last update in July.
3. Adding --registrar:static
4. Adding -gcc_flags -dead_strip which reduce the errors but still results in this error
___2018-08-24T22:01:20.5791820Z clang : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/vsts/agent/2.136.1/work/1/s/Client/projectName.Client.Forms/iOS/projectName.Forms.iOS.csproj]
2018-08-24T22:01:20.5920220Z error MT5209 : Native linking error : reference to symbol (which has not been assigned an address) _WebPInitYUV444Converters in '_CustomSetup' from /Users/vsts/agent/2.136.1/work/1/s/Client/projectName.Client.Forms/iOS/obj/iPhone/Release/mtouch-cache/WebP.a(libwebpdecode_la-io_dec.o) for architecture armv7 [/Users/vsts/agent/2.136.1/work/1/s/Client/projectName.Client.Forms/iOS/projectName.Forms.iOS.csproj]
2018-08-24T22:01:20.6050340Z MTOUCH : error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -dead_strip [/Users/vsts/agent/2.136.1/work/1/s/Client/projectName.Client.Forms/iOS/projectName.Forms.iOS.csproj]
2018-08-24T22:01:20.6130420Z MTOUCH : error MT5202: Native linking failed. Please review the build log. [/Users/vsts/agent/2.136.1/work/1/s/Client/projectName.Client.Forms/iOS/projectName.Forms.iOS.csproj]
2018-08-24T22:01:20.6148240Z
2018-08-24T22:01:20.6180880Z 60 Warning(s)
2018-08-24T22:01:20.6215590Z 4 Error(s)
various --linkskip options to suspect nuget dlls .
How do I get the full error? Can i by pass these ? Here's the a portion of the log file, any help/pointers is greatly appreciated.
2018-08-29T07:57:46.1674730Z duplicate symbol _WebPMultRows in:
2018-08-29T07:57:46.1761750Z /Users/vsts/agent/2.138.6/work/1/s/Client/projectName.Client.Forms/iOS/obj/iPhone/Staging/mtouch-cache/WebP.a(libwebpdspdecode_la-alpha_processing.o)
2018-08-29T07:57:46.1944120Z /Users/vsts/agent/2.138.6/work/1/s/Client/projectName.Client.Forms/iOS/obj/iPhone/Staging/mtouch-cache/liblibwebp.a(alpha_processing.o)
2018-08-29T07:57:46.2117500Z duplicate symbol _WebPMultARGBRows in:
2018-08-29T07:57:46.2265350Z /Users/vsts/agent/2.138.6/work/1/s/Client/projectName.Client.Forms/iOS/obj/iPhone/Staging/mtouch-cache/WebP.a(libwebpdspdecode_la-alpha_processing.o)
Possible reasons for this error:
The same native library is included twice.
Two distinct native libraries happen to define the same symbols.
A native library is not correctly built, and contains the same symbol
more than once. You can confirm this by using the following set of
commands from a terminal (replace i386 with x86_64/armv7/armv7s/arm64
according to which architecture you're building for):
for more information you can access link error-messages
What worked for me was adding the following to mtouch arguments in all configurations, specifically for release|iphone (simulator was working prior)
--registrar:static -gcc_flags "-framework libSkipSharp -dead_strip"
This link was instrumental including a lot trial and error: https://learn.microsoft.com/en-us/xamarin/ios/troubleshooting/mtouch-errors#mt5xxx-gcc-and-toolchain-error-messages

Resources