2

I am trying to update a Xamarin.iOS binding which points to code that I manage, and I'm having trouble now that I've replaced an external .a library reference with a .framework. Particularly, when I try to compile my binding, native linking is failing for the library which I replaced.

Native linking error: framework not found SVGKit for architecture arm64/i386/armv7/armv7s (MT5209)

I know for a fact that SVGKit supports these architectures, but I'm unsure how to include them in the generated binary when referencing from a .framework.

Nathan Taylor
  • 24,423
  • 19
  • 99
  • 156

1 Answers1

3

Hello I would do this to diagnose the issue

First I would check if SVGKit.framework/SVGKitis a fake framework (static library disguised as a framework) or a dynamic one (iOS 8+ support only) using the file command on the binary

file Foo.framework/Foo
Foo.framework/Foo: Mach-O universal binary with 4 architectures
Foo.framework/Foo (for architecture i386):  Mach-O dynamically linked shared library i386
Foo.framework/Foo (for architecture x86_64):Mach-O 64-bit dynamically linked shared library x86_64
Foo.framework/Foo (for architecture armv7): Mach-O dynamically linked shared library arm
Foo.framework/Foo (for architecture arm64): Mach-O 64-bit dynamically linked shared library

file Bar.framework/Bar
Bar.framework/Bar: Mach-O universal binary with 4 architectures
Bar.framework/Bar (for architecture armv7): current ar archive random library
Bar.framework/Bar (for architecture i386):  current ar archive random library
Bar.framework/Bar (for architecture x86_64):current ar archive random library
Bar.framework/Bar (for architecture arm64): current ar archive random library

Foo is a dynamic library, notice the Mach-O and Bar is a static library disguised as a framework notice the ar

Now if it is a fake framework (static library) just take the SVGKit.framework/SVGKit binary and rename it to SVGKit.a and add it to your binding project, it should work as usual

If it is a Dynamic Framework then follow these instructions on how to do it.[0]

[0]: Just a side note, once Xamarin Studio 6.0 is out you will not need to manually modify the binding project .csproj file, you will be able to do it within the IDE itself :)

dalexsoto
  • 3,412
  • 1
  • 27
  • 43
  • Thank you for the feedback. I've done as suggested and determined that it was a dynamic framework. I then followed the instructions, adding an element to binding's CSProj file with a ..\..\relative\path to the framework. Same build error, though. Also, no note of the the framework anywhere in the build log before the error. – Nathan Taylor Apr 13 '16 at 18:28
  • mmm strange, you could take a look at a project I contribute to and have working here https://github.com/PSPDFKit/Xamarin-iOS/blob/master/PSPDFKit.iOS/PSPDFKit.iOS.csproj#L52-L54 and see if it works for you, it is using a dynamic framework too. Let me know if that works for you. Also if you share or have your project somewhere (i.e. github) I can have a look :) – dalexsoto Apr 13 '16 at 19:28