netpyoung / SqlCipher4Unity3D

💾 SqlCipher made easy for Unity3d
MIT License
163 stars 37 forks source link

iPhone build crashes on device - Unity 2020.33 #38

Closed Kevdome3000 closed 3 years ago

Kevdome3000 commented 3 years ago

I've searched for hours and can't figure this one out. This happens right at launch when I'm attempting to check if a db file already exists and if not, build a new one.

I've tried link.xml files but no luck. Any Ideas?

XCode logs:

NotSupportedException: ./External/il2cpp/builds/libil2cpp/icalls/mscorlib/System.Reflection/CustomAttributeData.cpp(17) : Unsupported internal call for IL2CPP:CustomAttributeData::ResolveArgumentsInternal - "IL2CPP does not support inspection of attribute constructor arguments at run time." at System.Reflection.CustomAttributeData.ResolveArguments () [0x00000] in <00000000000000000000000000000000>:0 at System.Reflection.CustomAttributeData.get_ConstructorArguments () [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.Orm.InflateAttribute (System.Reflection.CustomAttributeData x) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.Orm+<>c.b12_1 (System.Reflection.CustomAttributeData x) [0x00000] in <00000000000000000000000000000000>:0 at System.Func2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0 at System.Linq.Enumerable+WhereSelectEnumerableIterator2[TSource,TResult].MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.TableMapping+Column..ctor (System.Reflection.PropertyInfo prop, SqlCipher4Unity3D.CreateFlags createFlags) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.TableMapping..ctor (System.Type type, SqlCipher4Unity3D.CreateFlags createFlags) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.SQLiteConnection.GetMapping (System.Type type, SqlCipher4Unity3D.CreateFlags createFlags) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.SQLiteConnection.CreateTable (System.Type ty, SqlCipher4Unity3D.CreateFlags createFlags) [0x00000] in <00000000000000000000000000000000>:0 at System.Func2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0 at SqlCipher4Unity3D.SQLiteAsyncConnection+<>c__DisplayClass34_0`1[T].b0 () [0x00000] in <00000000000000000000000000000000>:0 at System.Func`1[TResult].Invoke () [0x00000] in <00000000000000000000000000000000>:0 at XXXXX.Database.DataServiceAsync+d4.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at XXXXXX.Database.DataServiceAsync.CreateDB () [0x00000] in <00000000000000000000000000000000>:0 at BootStrap+d6.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at BootStrap.Start () [0x00000] in <00000000000000000000000000000000>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 at BootStrap+d__6.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at BootStrap.Start () [0x00000] in <00000000000000000000000000000000>:0

netpyoung commented 3 years ago

That problem caused by ConstructorArguments on iOS's IL2CPP environment.

I manually modified on Column(https://github.com/netpyoung/SqlCipher4Unity3D/blob/f9819ce1128f1e930a78c98c8b82e8bd981fd05e/SqlCipher4Unity3D/Assets/SqlCipher4Unity3D/Sqlite3Connection.cs#L2454) but not on InflateAttribute.

and I found sqlite-net's pull request.

I will apply this on this repo but I can't test on iOS/Mac device(i don't have device yet...)

After apply that pr, I will comment again on this issue

netpyoung commented 3 years ago

I pushed script on master branch.

But I don't have device.... so Could you test that script on your device?

Kevdome3000 commented 3 years ago

Hey,

Just tested and it worked! Thanks for helping out so quickly.

I'll close this now