本文介绍了Xamarin.Forms/Xamarin iOS中Akavache的可能错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Akavache的实现适用于Android调试和发布以及iOS调试模式.但是,它在iOS发布模式下崩溃.

Implementation of Akavache works on Android debug and release and iOS debug mode. However, it crashes on iOS release mode.

从Raygun截获的异常是'Akavache.Sqlite3.Internal.SQLiteConnection'的类型初始值设定项引发了异常.

The exception thrown, intercepted from Raygun, is The type initializer for 'Akavache.Sqlite3.Internal.SQLiteConnection' threw an exception.

只需部署iOS发布模式,并获得有关异常的提示.感激遇到类似问题的任何人都可以帮忙.

Simply deploy iOS release mode and get prompted with the exception. Appreciate if anyone who had experienced similar issue could help.

Akavache版本是6.0.0-alpha0038.

Akavache version is 6.0.0-alpha0038.

完整堆栈跟踪如下:

Akavache.Sqlite3.Registrations +<> c__DisplayClass0_0.b__3()在:0中 < 412cf7afb8e84872aee33a6b0acc7f20#a572ceb4cff14caae1629fe17a67dfc3>:0中的Splat.ModernDependencyResolver.GetService(System.Type serviceType,System.String合同) < 412cf7afb8e84872aee33a6b0acc7f20#a572ceb4cff14caae1629fe17a67dfc3>:0中的Splat.DependencyResolverMixins.GetService [T](Splat.IDependencyResolver This,System.String contract) < 6b3110b6f37348ddb9bd9456cdb85f61#a572ceb4cff14caae1629fe17a67dfc3>:0中的Akavache.BlobCache.get_UserAccount() < 2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0

Akavache.Sqlite3.Registrations+<>c__DisplayClass0_0.b__3() in :0 Splat.ModernDependencyResolver.GetService(System.Type serviceType, System.String contract) in <412cf7afb8e84872aee33a6b0acc7f20#a572ceb4cff14caae1629fe17a67dfc3>:0 Splat.DependencyResolverMixins.GetService[T](Splat.IDependencyResolver This, System.String contract) in <412cf7afb8e84872aee33a6b0acc7f20#a572ceb4cff14caae1629fe17a67dfc3>:0 Akavache.BlobCache.get_UserAccount() in <6b3110b6f37348ddb9bd9456cdb85f61#a572ceb4cff14caae1629fe17a67dfc3>:0 XXX.UI.CompositionRoot.CreateBlobCache() in <2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0

< 2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0中的XXX.UI.CompositionRoot.CreateApp() < 2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0中的XXX.UI.CompositionRoot.LoggedCreation [T](System.Func`1 [TResult] factory) < 2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0

XXX.UI.CompositionRoot.CreateApp() in <2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0 XXX.UI.CompositionRoot.LoggedCreation[T](System.Func`1[TResult] factory) in <2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0 XXX.UI.CompositionRoot.CreateApp() in <2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0

< 2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0中的XXX.UI.CompositionRoot.ResolveApp() :0中的XXX.UI.iOS.AppDelegate.ResolveApplication(XXX.UI.CompositionRoot compositionRoot) XXX.UI.iOS.AppDelegate.FinishedLaunching(UIKit.UIApplication应用,Foundation.NSDictionary选项),位于:0中 UIKit.UIApplication.Main(System.String [] args,System.IntPtr委托人,System.IntPtr委托),在:0中 UIKit.UIApplication.Main(System.String [] args,System.StringPrincipalClassName,System.String委托ClassName),位于:0 :0.p中的XXX.UI.iOS.Application.Main(System.String [] args)

XXX.UI.CompositionRoot.ResolveApp() in <2815cf10ecb04f8fa012a0a005f4202e#a572ceb4cff14caae1629fe17a67dfc3>:0 XXX.UI.iOS.AppDelegate.ResolveApplication(XXX.UI.CompositionRoot compositionRoot) in :0 XXX.UI.iOS.AppDelegate.FinishedLaunching(UIKit.UIApplication app, Foundation.NSDictionary options) in :0 UIKit.UIApplication.Main(System.String[] args, System.IntPtr principal, System.IntPtr delegate) in :0 UIKit.UIApplication.Main(System.String[] args, System.String principalClassName, System.String delegateClassName) in :0 XXX.UI.iOS.Application.Main(System.String[] args) in :0

推荐答案

链接可能有问题...

It might be an issue with linking...

您可以尝试跳过Akavache Dll的链接吗?

Can you try link skipping the Akavache Dlls?

还是使用链接器文件排除它们,看看是否可行?

Or using a linker file to exclude them and see if that works?

还要确保您拥有 https://github.com/PureWeen/Akavache/blob/3bd03246a6e198bde5eb93a54646dd9f25fc15a1/src/Akavache.Sqlite3/content/AkavacheSqliteLinkerOverride.cs.pp

平台项目中的文件

iOS的主要问题是Xamarin工具使用静态分析来删除它认为您的任何代码引用都没有的dll. Akavache使用Reflection来查找您是否使用了Xamarin无法检测到的SqlLite Dll,因此在DLL被删除的发行版本中:-/

the main problem with iOS is that the Xamarin tools use static analysis to remove dlls that it doesn't think any of your code references. Akavache uses Reflection to find if you are using the SqlLite Dll which Xamarin can't detect so with release versions that DLL gets removed :-/

Override类仅提供您想要的Dll工具信息

The Override class just gives the tools information that you want that Dll

这篇关于Xamarin.Forms/Xamarin iOS中Akavache的可能错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 05:50