Xamarin.iOS binding with third party framework

大兔子大兔子 提交于 2019-12-07 22:17:27

问题


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.


回答1:


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 :)



来源:https://stackoverflow.com/questions/36584414/xamarin-ios-binding-with-third-party-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!