Native linking failed - xamarin

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

Related

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

Native Binding project fails with MTOUCH: error MT5210: Native linking failed, undefined symbol

Using objective sharpie I created a binding project for an internal Objective C library, the binding project includes three ios framework sources
The binding project builds fine and produces an output dll as expected, checking the output dll with iLSpy confirms that the native references are included in the dll. A demo app was created to test the binding, but the problem is I can not get the demo app to compile, it fails with
Undefined symbols for architecture x86_64:
"_IOS_DERIVED_CREDENTIALS", referenced from: _IOS_STORAGE in
IdentosSDK(ios_storage.o) "_OPENSSL_DERIVED_CREDENTIALS",
referenced from: _OPENSSL_STORAGE in
IdentosSDK(openssl_storage.o) "_OPENSSL_EC", referenced from:
_create_key_with_type in IdentosSDK(openssl_storage_identity.o) "_PENDING_REGISTRATION", referenced from:
_to_initialized_state in IdentosSDK(id_start_state.o)
before finally failing with this
MTOUCH : error MT5210: Native linking failed, undefined symbol:
_IOS_DERIVED_CREDENTIALS. 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: _OPENSSL_DERIVED_CREDENTIALS. Please verify that all the
necessary frameworks have been referenced and native libraries are
properly linked in.
I have tried passing gcc_flags passed to mtouch as shown below
I know the framework in the binding project supports the appropriate architectures as running lipo -info libIdentosSDK.a produces: armv7 i386 x86_64 arm64
Not sure what else to do to fix this. Any help will be appreciated. The complete build log
MTOUCH : error MT5210: Native linking failed, undefined symbol: _IOS_DERIVED_CREDENTIALS. 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: _OPENSSL_DERIVED_CREDENTIALS. 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: _OPENSSL_EC. 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: _PENDING_REGISTRATION. 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: _add_events. 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: _asym_decrypt. 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: _asym_encrypt. 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: _asym_free. 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: _asym_sign. 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: _asym_verify. 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: _cleanup_events. 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: _create_event. 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: _create_event_bool. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

Google Analytics issue on Xamarin.ios

I am building xamarin.forms project and integrated google analytics for ios and droid.
Currently I used Google Analytics for iOS framework by installed nuget for xamarin.ios. By the way, when I build ios, native library linking failed exception happens.
How can I fix this issue?
Here is exception lists.
Error Native linking failed, undefined symbol: __monodroid_lref_log_delete. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_lref_log_delete. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_max_gref_get. This symbol was referenced by the managed member Java.Interop.Runtime._monodroid_max_gref_get. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_weak_gref_new. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_weak_gref_new. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_gref_get. This symbol was referenced by the managed member Android.Runtime.AndroidObjectReferenceManager._monodroid_gref_get. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_getifaddrs. This symbol was referenced by the managed member Android.Runtime.AndroidEnvironment._monodroid_getifaddrs. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_gref_log_new. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_gref_log_new. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: _monodroid_typemap_managed_to_java. This symbol was referenced by the managed member Android.Runtime.JNIEnv.monodroid_typemap_managed_to_java. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_gc_wait_for_bridge_processing. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_gc_wait_for_bridge_processing. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_freeifaddrs. This symbol was referenced by the managed member Android.Runtime.AndroidEnvironment._monodroid_freeifaddrs. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_lref_log_delete. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_lref_log_delete. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed. Please review the build log.
Error Native linking failed, undefined symbol: __monodroid_detect_cpu_and_architecture. This symbol was referenced by the managed member Android.Runtime.AndroidEnvironment._monodroid_detect_cpu_and_architecture. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_gref_log_delete. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_gref_log_delete. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: _monodroid_typemap_java_to_managed. This symbol was referenced by the managed member Java.Interop.TypeManager.monodroid_typemap_java_to_managed. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_timezone_get_default_id. This symbol was referenced by the managed member Android.Runtime.AndroidEnvironment._monodroid_timezone_get_default_id. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_lref_log_new. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_lref_log_new. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_weak_gref_delete. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_weak_gref_delete. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_get_identity_hash_code. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_get_identity_hash_code. Please verify that all the necessary frameworks have been referenced and native libraries linked.
Error Native linking failed, undefined symbol: __monodroid_gref_log. This symbol was referenced by the managed member Android.Runtime.JNIEnv._monodroid_gref_log. Please verify that all the necessary frameworks have been referenced and native libraries linked.
I had the same weird error. My fix was to remove the Mono.Android reference from PCL and then clean and rebuild fixed all the above errors.
In my case Mono.Android reference was actually a required reference but, to get rid of these errors, I commented out the code in PCL that was using Mono.Android . After a successful build ( without Mono.Android ), I reverted the code in PCL and added Mono.Android reference back to PCL . Surprisingly a clean and rebuild with Mono.Android as a reference in PCL worked this time ! I have no clue how .

Xamarin.iOS Framework binding + FastPdfKit

I have a static library (.a) whose include "FastPdfKit.framework". (My Xcode project runs correctly)
This static library is included in xamarin project and i have to bind "FastPdfKit.framework".
So i did: project options -> iOS Build -> Additionnal mtouch arguments (--framework:${ProjectDir}/frameworks/FastPdfKit.framework).
But this mani doesn't run, i've got linked error:
ld: warning: ignoring file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit,
missing required architecture arm64 in file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit
(2 slices) Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_MFDocumentManager", referenced from:
objc-class-ref in MyLib.a(Page.o)
"_OBJC_CLASS_$_ReaderViewController", referenced from:
objc-class-ref in MyLib.a(Page.o)
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed
with exit code 1 (use -v to see invocation)
MTOUCH: error MT5209: Native linking error: warning: ignoring file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit,
missing required architecture arm64 in file
/Users/../Documents/XAMARIN/MyApp.IOS/frameworks/FastPdfKit.framework/FastPdfKit
(2 slices) MTOUCH: error MT5211: Native linking failed, undefined
Objective-C class: MFDocumentManager. The symbol
'_OBJC_CLASS_$_MFDocumentManager' could not be found in any of the
libraries or frameworks linked with your application. MTOUCH: error
MT5211: Native linking failed, undefined Objective-C class:
ReaderViewController. The symbol '_OBJC_CLASS_$_ReaderViewController'
could not be found in any of the libraries or frameworks linked with
your application.
MTOUCH: error MT5202: Native linking failed. Please
review the build log.
Can anyone help me???
Thanks,
Yann
OK, i found.
It was architecture problem. I don't know why because I set architecture option correctly, but not all of architecture setting was generated
Use command line "xcrun -sdk iphoneos lipo -info MyLib.a" to check which architecture is generated.
The error is really very clear, the librarty doesn't support the arm64 architecture as is requested by the project, you need a library compatible with your project's architectures.

Resources