简体   繁体   English

IOS Xamarin SQLite 的 JIT 问题

[英]JIT issues with IOS Xamarin SQLite

So I have some classes that I have been storing in a local SQLite DB in a Xamarin Forms application.所以我有一些类,我一直在 Xamarin Forms 应用程序的本地 SQLite DB 中存储。 Works fine on UWP, Android, and iOS except for Release on a physical device.在 UWP、Android 和 iOS 上运行良好,但在物理设备上发布除外。 Keep getting JIT warnings.不断收到 JIT 警告。 I've tried removing linking various ways to ensure it's getting compiled but no dice.我已经尝试删除各种链接方式以确保它被编译但没有骰子。 The root of the issue seems to be within the usage of SQLite-Net-pcl nuget library.问题的根源似乎在于 SQLite-Net-pcl nuget 库的使用。 Does anyone have advice on how to ensure that code has been AOT compiled?有人对如何确保代码已被 AOT 编译有建议吗? My abstract class, maybe too abstract?我的抽象class,可能太抽象了? Not sure.没有把握。

public abstract class SqlRepositoryLite<T, TInterface> : IRepositoryLite<TInterface> where T : class, IDto, TInterface, new()
{
 
    public IEnumerable<TInterface> Items => Connection.Table<T>();

Crash reports:崩溃报告:

SIGABRT: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_CharacterItem_int (PFAssistant.Core.Services.CharacterItem,int)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

Stacktrace:堆栈跟踪:

FastColumnSetter+<>c__DisplayClass2_0`2[ObjectType,ColumnMemberType].<CreateTypedSetterDelegate>b__0 (System.Object o, SQLitePCL.sqlite3_stmt stmt, System.Int32 i)
SQLiteCommand+<ExecuteDeferredQuery>d__12`1[T].MoveNext ()
List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable)
System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) <0x1052cce30 + 0x0021f> in <25bf495f7d6b4944aa395b3ab5293479#0dcf7231fb8229d159bd9a1419156fe3>:0
Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source)
SQLiteCommand.ExecuteQuery[T] ()

Update: Would seem updating Sqlite-net-pcl to v1.8.116 was a major part of my issue, had issues with 1.6.292 as well.更新:似乎将 Sqlite-net-pcl 更新到 v1.8.116 是我问题的主要部分,1.6.292 也有问题。 1.7.335 worked perfectly. 1.7.335 完美运行。

I found the same to be the case today.我发现今天的情况也是如此。 Downgrading to 1.7.335 is the solution.降级到 1.7.335 是解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM