Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native linking failed, duplicate symbol: '_main' while adding native Binding Dll and Xamarin.Firebase.iOS.Database

I have tried adding and implementing the native Binding Dll and Xamarin.Firebase.iOS.Database in my Xamarin project using NuGet but I am unable to build my project due to below error :

Error MT5213: Duplicate symbol in: ///obj/iPhone/Debug/device-builds/iphone8.1-11.4/mtouch-cache/arm64/main.o (Location related to previous error) (MT5213)

Duplicate symbol in: ///obj/iPhone/Debug/device-builds/iphone8.1-11.4/mtouch-cache/leveldb-library(leveldb_main.o) (Location related to previous error) (MT5213)

Also, I have added "--registrar:static" in the additional mtouch arguments.

Kindly suggest with the best possible way to resolve the above issues.

Thank you.

like image 416
Sujeet Shetty Avatar asked Jul 04 '18 17:07

Sujeet Shetty


1 Answers

If you have added "--registrar:static" argument properly try to follow below steps In Visual Studio,

  • Open the project settings of your iOS project
  • Go to Build > iOS Build
  • Select Configuration Release and Platform iPhone * Next to Supported architectures select ARMv7 + ARM64 instead of ARMv7 + ARMv7s + ARM64.

& make sure Update to macOS High Sierra

The most recent version of Xcode requires macOS High Sierra (10.13). developers should update to macOS High Sierra as soon as possible in order to support the Xcode 9.3 SDKs and API. Find another possible answer here

Moreover, this thread might be helpful

like image 101
R15 Avatar answered Nov 06 '22 10:11

R15