首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Xamarin Forms Linker与Prism.Dryioc

Xamarin Forms Linker与Prism.Dryioc
EN

Stack Overflow用户
提问于 2018-01-03 10:22:24
回答 1查看 957关注 0票数 1

Soo,当我们使用Xamarin表单时,我们想要一个小的apk大小。为了达到这个目标,我们有Linker和Pro卫士。

但是使用Prism.Dryioc时,我真的不知道如何正确地设置我的链接配置文件。

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>
<linker>
  <assembly fullname="Prism.Forms">
      <type fullname="Prism.Common.ApplicationProvider" preserve="all" />
      <type fullname="Prism.Services.PageDialogService" preserve="all" />
      <type fullname="Prism.Services.DeviceService" preserve="all" />
  </assembly>

   <assembly fullname="Prism.DryIoc.Forms" >
      <namespace fullname="Prism.DryIoc" preserve="all" />
   </assembly>
   <assembly fullname="Prism">
      <namespace fullname="Prism.Ioc" preserve="all" />
   </assembly>
   <assembly fullname="netstandard">
      <namespace fullname="System.Reflection" preserve="all" />
      <namespace fullname="System.Xml" preserve="all" />
   </assembly>
 </linker>

有了上述情况,我得到了一个例外:

01-03 17:14:04.526 I/MonoDroid(28121):未处理异常: 01-03 17:14:04.552 I/MonoDroid(28121):System.TypeInitializationException:注册表的类型初始化程序抛出一个异常。-> System.TypeInitializationException:“DryIoc.WrappersSupport”的类型初始化程序抛出一个异常。-> DryIoc.ContainerException:类型为MethodInfo的参数为null。01-03 17:04.552 I/MonoDroid(28121):DryIoc.Throw.ThrowIfNullT 0x0002b in :0 01-03 17:14:04.552 I/MonoDroid(28121):at DryIoc.WrappersSupport..cctor () 0x0013e in :0 01-03 17:14:04.552 I/MonoDroid(28121):--内部异常堆栈跟踪-- 01-03 17:14:04.552 I/MonoDroid(28121):--内部异常堆栈跟踪-- 01 -01-03 17:14:04.552 I/MonoDroid(28121):at Prism.DryIoc.PrismApplication.CreateContainer () 0x00006 in <5381f1aa51c04a43a2c056545e4b1214>:0 01-03 17:14:04.552 I/MonoDroid(28121):at Prism.PrismApplicationBase1T.Initialize () 0x0001e在:0 01-03 17:04.552 I/MonoDroid(28121):at Prism.PrismApplicationBase1T.InitializeInternal () 0x00006 in :0 01-03 17:14:04.552 I/MonoDroid(28121):at Prism.PrismApplicationBase1T..ctor (Prism.IPlatformInitializer1T初始化器) 0x00031 in :0 01-03 17:14:04.552 I/MonoDroid(28121):at Prism.DryIoc.PrismApplication.set_ModuleCatalog (Prism.Modularity.IModuleCatalog值) 0x00000 in <5381f1aa51c04a43a2c056545e4b1214>:0 01-03 17:14:04.552 I/MonoDroid(28121):C:\Projetos\ECS_APP\Mobile\Mobile\App.xaml.cs:33 01-03 17:14:04.552 I/MonoDroid(28121):at Mobile.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) 0x000b2 in C:\Projetos\ECS_APP\Mobile\Mobile.Android\MainActivity.cs:41 01-03 17:14:04.552 I/MonoDroid(28121):at Android.Support.V4.App.FragmentActivity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv,System.Object:8b2e8b21-fb7e-4a04-a143-a1dc11f69d85 ( System.IntPtr native__this,System.IntPtr native_savedInstanceState) 0x0000f in <0c9457d7bcf04178944f1369257ca37d>:0 01-03 17:14:04.552 I/MonoDroid(28121):at (包装动态-方法)native__this (intptr,intptr,intptr) 01-03 17:14:04.577 W/art (28121):JNI RegisterNativeMethods:尝试为android.runtime.JavaProxyThrowable注册0个未处理异常。

有人能帮我找到让Linker起作用的方法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-09 13:39:14

我的链接文件是非常错误的。很多小时后我就修好了。

代码语言:javascript
复制
?xml version="1.0" encoding="utf-8" ?>
<linker>

<assembly fullname="SQLite-net">
  <type fullname="*" />
</assembly>

<assembly fullname="SQLitePCLRaw.batteries_v2">
  <type fullname="*" />
</assembly>

<assembly fullname="SQLitePCLRaw.core">
  <type fullname="*" />
</assembly>

<assembly fullname="DryIoc">
  <type fullname="*" />
</assembly>

<assembly fullname="System">
  <type fullname="*" />
</assembly>

<assembly fullname="mscorlib">
  <type fullname="*" />
</assembly>

<assembly fullname="Prism">
  <type fullname="*" />
</assembly>

<assembly fullname="Prism.DryIoc.Forms">
  <type fullname="*" />
</assembly>

<assembly fullname="MyProjectPCL">
  <type fullname="*" />
</assembly>

<assembly fullname="Prism.Forms">
  <type fullname="*" />
</assembly>

<assembly fullname="Plugin.Permissions">
  <type fullname="*" />
</assembly>

<assembly fullname="Xamarin.Forms.Maps">
  <type fullname="*" />
</assembly>

 <assembly fullname="Newtonsoft.Json">
   <type fullname="*" />
</assembly>

</linker>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48075447

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档