SQLite4Unity3d icon indicating copy to clipboard operation
SQLite4Unity3d copied to clipboard

Indexing on iOS causes JIT compile problem

Open markyama opened this issue 10 years ago • 3 comments

I’m getting an exception when running on an iOS device if I add [Indexed] to an int column. The Exception occurs when I call CreateTable<MyObject>() on the ISQLiteConnection. If I remove the [Indexed] flag, the JIT exception goes away.

ExecutionEngineException: Attempting to JIT compile method 'System.Linq.OrderedEnumerable`1<SQLite4Unity3d.SQLiteConnection/IndexedColumn>:GetEnumerator ()' while running with --aot-only.

Is there a way to solve these JIT problems with System.Linq and iOS? Or must I live without indexes for iOS?

I’m using Unity 5.0.1f1 with Xcode 6.3.1.

I have not fully integrated SQLite4Unity3d into my app and I’m worried that if I go down this route if I’ll have future problems with JIT on iOS?

Thanks

markyama avatar May 14 '15 18:05 markyama

Hi Markyama,

I will take a look at it as soon as possible and get back to you. You know it's a little tricky to solve some JIT limitations affecting reflection and sometimes is not possible to overcome the issues. I'll do my best and let you know.

Best regards.

robertohuertasm avatar May 14 '15 21:05 robertohuertasm

Well, this document may be helpful(in some way; since it had written before IL2CPP came out.)

https://github.com/neuecc/UniRx/wiki/AOT-Exception-Patterns-and-Hacks

pokehanai avatar Jun 05 '15 06:06 pokehanai

Maybe you can just create the index by running the following after you have created the table?

_connection.Query<int>("CREATE INDEX tablename_idx ON tablename (columnname)");

Marreck avatar Oct 23 '15 08:10 Marreck