Xamarin 使用经验-字符集及动态编译

在使用Xamarin时遇到如下两个问题,花费很多时间

1、在Debug方式时可用使用 GBK 字符集,发行版不行
2、使用动态编译的代码Debug方式时可用使用,发行版使用Runtime库可用,形成单独 apk 出错。

解决办法:

Android Option 如下修改:

 

CJK 指定支持双字节编码
Skip linking assembiles 解决第二个问题,使用  linking 的 None 选项也能解决问题,但 apk 包太大。 原因如下:


Xamarin.Android applications use a linker in order to reduce the size of the application. The linker employes static analysis of your application to determine which assemblies are actually used, which types are actually used, and which members are actually used. The linker then behaves like a garbage collector, continually looking for the assemblies, types, and members that are referenced until the entire closure of referenced assemblies, types, and members is found. Then everything outside of this closure is discarded.

Linker Behavior
 

The primary mechanism for controlling the linker is the Linker Behavior drop-down within the Project Options dialog box. There are three options:

  1. Don't Link
  2. Link SDK Assemblies
  3. Link All Assemblies

The Don't Link option turns off the linker; the above "Release without Linking" application size used this behavior. This is useful for troubleshooting runtime failures, to see if the linker is responsible.

The Link SDK Assemblies option only links assemblies that come with Xamarin.Android. All other assemblies are not linked.

The Link All Assemblies option links all assemblies.







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值