1

因此,我有一些类一直存储在 Xamarin Forms 应用程序的本地 SQLite DB 中。在 UWP、Android 和 iOS 上运行良好,但在物理设备上发布除外。不断收到 JIT 警告。我已经尝试删除各种链接方式以确保它被编译但没有骰子。问题的根源似乎在于 SQLite-Net-pcl nuget 库的使用。有人对如何确保代码已被 AOT 编译有建议吗?我的抽象类,也许太抽象了?没有把握。

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

崩溃报告:

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.

堆栈跟踪:

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] ()

更新:似乎将 Sqlite-net-pcl 更新到 v1.8.116 是我问题的主要部分,1.6.292 也有问题。1.7.335 完美运行。

4

0 回答 0