简体   繁体   中英

Xamarin.iOS binding with third party framework

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.

Hello I would do this to diagnose the issue

First I would check if SVGKit.framework/SVGKit is 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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM