我们应该支持哪些 Xamarin ABI [英] Which Xamarin ABIs should we support

查看:36
本文介绍了我们应该支持哪些 Xamarin ABI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我们的 Xamarin Android 应用 (PCL) 在我看来是巨大的,即使在发布模式下也是如此.我怀疑这是由于支持的架构.目前,我们已将它们全部选中.有谁知道我们是否必须选择所有这些?我们也根本没有使用 Android NDK.

Currently our Xamarin Android app (PCL) is huge in my opinion, even in release mode. I suspect it is due to supported architectures. Currently we have them all selected. Does anyone know if we have to select all of these? We are not using the Android NDK at all as well.

推荐答案

我将从这里复制我的部分答案.

I will copy part of my answer from here.

确保您至少检查以下架构:armeabi-v7a 和 x86.您可以执行其他三个,但我们不这样做,因为我们在发布模式下使用 LLVM 编译,这与 64 位架构不兼容(除了 armeabi,已弃用).这样做的好处是所有 64 位架构仍然可以使用 32 位构建,因此如果您检查这 3 个,它们仍然会被覆盖.

Make sure you are at least checking the following architectures: armeabi-v7a and x86. You could do the other three but we do not since we use LLVM compiling in release mode, which is not compatible with the 64 bit architectures (except for armeabi, which is deprecated). The good thing about that is that all of the 64 bit architectures can still use 32 bit builds so they all still get covered if you check those 3.

所以我只会检查这 3 个,除非您有特定的理由检查其他的.我们在仅使用这 3 个的设备上安装我们的应用时遇到了 0 个问题.

So I would just check those 3 unless you have a specific reason to check the other ones. We have had 0 problems installing our app on devices using those 3 only.

顺便说一句,打开 LLVM 编译和优化您的图标/图像将有助于最终的 APK 大小.

On a side note, turning on LLVM compiling and optimizing your icons/images will help with the final APK size.

*自从撰写本文以来,我们遇到了一个错误,仅在某些设备(Android Nexus 9)在启动应用程序时会导致应用程序崩溃.解决方案是检查arm64-v8a 架构.这可能会增加应用大小,因此请权衡利弊,看看在包含架构后对您的 APK 大小有多大影响,或者在必要时为每个架构拆分 APK.

* Since writing this we ran into a bug only on certain devices (Android Nexus 9) which leads to app crashes when launching the app. The solution is to check the arm64-v8a architecture. This will probably increase app size so weigh the pros and cons and see how much of a difference it makes in your APK size after including the architecture or split your APK for each architecture if necessary.

这篇关于我们应该支持哪些 Xamarin ABI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆