Xamarin.Forms(2.5.0.122203)使用Zxing.Net.Mobile.Forms(2.3.3)时,Android端莫名崩溃

Posted Devin.Zhou

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Xamarin.Forms(2.5.0.122203)使用Zxing.Net.Mobile.Forms(2.3.3)时,Android端莫名崩溃相关的知识,希望对你有一定的参考价值。

Xamarin.Forms(2.5.0.122203)使用Zxing.Net.Mobile.Forms(2.3.3)时,android端莫名崩溃

折磨了将近一个月的问题,终于得到解决啦,当然还是希望作者能够尽快支持.net standard。

现象:新建基于NETStandard的Xamarin.Forms项目,通过NuGet安装Zxing.Net.Mobile.Forms(2.3.3)插件后,Android端运行崩溃。

Github问题地址:https://github.com/Redth/ZXing.Net.Mobile/issues/578

解决办法如下:

  1. 编辑xxx.csproj

在PropertyGroup中添加节点:<AssetTargetFallback>$(AssetTargetFallback);net46;</AssetTargetFallback>

<PropertyGroup>
     <TargetFramework>netstandard1.4</TargetFramework> 
     <AssetTargetFallback>$(AssetTargetFallback);net46;</AssetTargetFallback> 
</PropertyGroup>

 

  1. Clean项目,尤其是Android项目

 

 

 

以上是关于Xamarin.Forms(2.5.0.122203)使用Zxing.Net.Mobile.Forms(2.3.3)时,Android端莫名崩溃的主要内容,如果未能解决你的问题,请参考以下文章