Not able to make archive ios app for publish - xamarin

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

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.

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

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 .

Resources