c# - Xamarin.iOS 与第三方框架的绑定(bind)
<p><p>我正在尝试更新指向我管理的代码的 Xamarin.iOS 绑定(bind),现在我遇到了麻烦,因为我已将外部 .a 库引用替换为 .framework。特别是,当我尝试编译绑定(bind)时,我替换的库的本地链接失败。</p>
<pre><code>Native linking error: framework not found SVGKit for architecture arm64/i386/armv7/armv7s (MT5209)
</code></pre>
<p>我知道 SVGKit 支持这些架构,但我不确定在从 .framework 引用时如何将它们包含在生成的二进制文件中。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>您好,我会这样做来诊断问题</p>
<p>首先我会检查 <code>SVGKit.framework/SVGKit</code> 是 <strong>fake framework</strong>(伪装成框架的静态库)还是动态的(<strong>iOS 8+仅支持</strong>)在二进制文件上使用 <code>file</code> 命令</p>
<pre><code>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
</code></pre>
<p><code>Foo</code> 是动态库,注意 <code>Mach-O</code> 和 <code>Bar</code> 是伪装成框架的静态库 注意 <code> ar</code></p>
<p>现在,如果它是一个 <strong>假框架</strong>(静态库),只需获取 <code>SVGKit.framework/SVGKit</code> 二进制文件并将其重命名为 <code>SVGKit.a</code> 并将其添加到您的绑定(bind)项目中,它应该像往常一样工作</p>
<p>如果是<strong>动态框架</strong>,请按照这些 <a href="https://developer.xamarin.com/guides/ios/advanced_topics/embedded_frameworks/" rel="noreferrer noopener nofollow">instructions on how to do it</a> .</p>
<p>:附带说明,一旦 Xamarin Studio 6.0 发布,您将无需手动修改绑定(bind)项目 <code>.csproj</code> 文件,您将能够在 IDE 本身内完成:)</p></p>
<p style="font-size: 20px;">关于c# - Xamarin.iOS 与第三方框架的绑定(bind),我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/36584414/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/36584414/
</a>
</p>
页:
[1]