Start a new topic

Failed building Xamarin Wikitude iOS component

Failed building Xamarin Wikitude iOS component


Hello!
I have a problem with Xamarin component Wikitude SDK for iOS. I added Wikitude SDK Xamarin component, but project has failed during building. In project except Wikitude I use Google play service, as I understand this errors linked to conflict between this two components. Can You can advise a solution to this problem ?

Part of errors:

/Users/***/Documents/TheWalk/TheWalk.iOS/MTOUCH: Error MT5212: Native linking failed, duplicate symbol: '_BN_bin2bn'. (MT5212) (TheWalk.iOS)

/Users/***/Documents/TheWalk/TheWalk.iOS/MTOUCH: Error MT5213: Duplicate symbol in: /Users/alla/Documents/TheWalk/TheWalk.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/libWikitudeSDK.a(bn_lib.o) (Location related to previous error) (MT5213) (TheWalk.iOS

/Users/***/Documents/TheWalk/TheWalk.iOS/MTOUCH: Error MT5213: Duplicate symbol in: /Users/alla/Documents/TheWalk/TheWalk.iOS/obj/iPhoneSimulator/Debug/mtouch-cache/GooglePlayGames.a(bn_lib.o) (Location related to previous error) (MT5213) (TheWalk.iOS)

Hi alla,
pls. note that the Wikitude iOS SDK/Component should build for the simulator, but does only show a black image as camera stream. You need to run it on a real iOS device in order to use the Wikitude SDK.
Besides that, my only advice is the following link, explaining how you can remove certain symbols from an existing static library.

Best regards

Andreas

Also i tried build project on device in (debug/release) mode, but it do not help, i again get error with "Native linking failed, duplicate symbol". Adding iOS build settings "Additional mtouch arguments - --registrar:static" also not working. I use Xamarin component , so i don't have access to binding library Wikitude.iOS. Seems that native library is no correctly build: http://developer.xamarin.com/guides/ios/troubleshooting/mtouch-errors/#MT5212_Native_linking_failed_duplicate_symbol_

As mentioned in your linked article, use the following steps to remove the duplicate symbols:

 

# Find out if the library is a fat library, and which
# architectures it contains.
lipo -info libNative.a

# Extract each architecture (i386/x86_64/armv7/armv7s/arm64) to a separate file
lipo libNative.a -thin ARCH -output libNative.ARCH.a

# Extract the object files for the offending architecture
# This will remove the duplicates by overwriting them
# (since they have the same filename)
mkdir -p ARCH
cd ARCH
ar -x ../libNative.ARCH.a

# Reassemble the object files in an .a
ar -r ../libNative.ARCH.a *.o
cd ..

# Reassemble the fat library
lipo *.a -create -output libNative.a


The Wikitude iOS Component does has a static library included, otherwise it wouldn't work at all. Search for WikitudeSDK.

 

Best regards

Andreas

Yes, i saw that, but it acceptable only for one-time compiling project, because each time after new build i'll need change libWikitudeSDK.a on repaired (via terminal) version. So can You fix native library and update component on Xamarin, like wrote in first way to solve this problem ?

MT5212: Native linking failed, duplicate symbol: *.

There are a few possible ways to fix this:


Request that the provider of the native library fix it and provide the updated version.

Fix it yourself by removing the extra object files (this only works if the problem is in fact duplicated object files)

Ask the linker to remove unused code. Xamarin.iOS will do this automatically if all of the following conditions are met:


All third-party bindings'  attributes have enabled SmartLink: <pre></pre>

No -gcc_flags is passed to mtouch (in the additional mtouch arguments field of the project's iOS Build options).



It's also possible to ask the linker directly to remove unused code by adding `-gcc_flags -dead_strip` to the additional mtouch arguments in the project's iOS Build options.

Tried follow steps "Fix it yourself by removing the extra object files (this only works if the problem is in fact duplicated object files)" that provide Xamarin to fix problem with Wikitude static library, but it didn't help. I really need good advice with this problem. Does someone faced with similar issue ?

Dear Alla,

Did you try the steps explained by Andreas? As we are not aware of this issue, did you also make sure that you follow the set-up guide from the Xamarin documentation seciton?

Thx and greetings

Nicola

Yes, libWikitudeSDK.a was successfully updated by steps that wrote Andreas Schacherbauer from Xamarin documentation for issue MT5212: Native linking failed, duplicate symbol: *. But after it, during compilation i get new stack another errors (please look at attacheched file). I understand that it not common issue. Also i investigated that issue,it occurs only if i use in my application two components Wikitude iOS and Google play for iOS (seems they have duplicate some files).

 

 

After some time that i had spent on investigation i found that was problem with Xamarin Insight package.
Login or Signup to post a comment