Google Analytics issue on Xamarin.ios - visual-studio

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 .

Related

Undefined Symbol when building in Xcode

I have recently got this problem when building for IOS. First time I got it I was able to restore an old version from Plastic backup and then restore each version until recent and the problem was gone. Now that does not work.
I have been googling a lot but do not understand how to solve this problem and would appreciate some help.
I also have not found a description what U3CPrivateImplementationDetailsU3E ... is.
The errors is:
Undefined symbol: _U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____499E4F5C84E20C7347E10100E0EC90C1945EA21C7C80809E4F7F474179B39DF6_12_FieldInfo_var
and
Undefined symbol: _U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____9DA6B2C4638D1DC7611B7F458BBFE7FD49FE1B36B67239B00B8A051F4E49558F_22_FieldInfo_var
Here is the Xcode log screenshot with the error part also in text below:
Undefined symbols for architecture arm64:
"_U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____499E4F5C84E20C7347E10100E0EC90C1945EA21C7C80809E4F7F474179B39DF6_12_FieldInfo_var", referenced from:
_Parser__cctor_m56CB9BAD206C2D94D0AC23E6E618F2AD736051E9 in libGameAssembly.a(hfu1rd9b20qx.o)
"_U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____9DA6B2C4638D1DC7611B7F458BBFE7FD49FE1B36B67239B00B8A051F4E49558F_22_FieldInfo_var", referenced from:
_XsdDateTime__cctor_m4F12859B35713836F38CE50985C1492A7EC4D441 in libGameAssembly.a(hfu1rd9b20qx.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbol: _U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____499E4F5C84E20C7347E10100E0EC90C1945EA21C7C80809E4F7F474179B39DF6_12_FieldInfo_var
Undefined symbol: _U3CPrivateImplementationDetailsU3E_tBAB6DC40B1709E21296656960228A17F1BE57FD7____9DA6B2C4638D1DC7611B7F458BBFE7FD49FE1B36B67239B00B8A051F4E49558F_22_FieldInfo_var
Build target Unity-iPhone of project Unity-iPhone with configuration ReleaseForRunning
/Users/xxxx/Dropbox/Unity3D/_CONTENT/MyApp/ExecutableIOS/Unity-iPhone.xcodeproj: warning: Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode. (in target 'Unity-iPhone' from project 'Unity-iPhone')
/Users/xxxx/Dropbox/Unity3D/_CONTENT/MyApp/ExecutableIOS/Unity-iPhone.xcodeproj: Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.
UPDATE
I deleted Unity executable folder and it seems to solve the problem. However, anyone knows what the problem is?

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

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.

Resources