Возникла проблема с запуском моего приложения xamarin forms на устройстве iOS.Он отлично работает в симуляторе.Приложение использует EntityFramework для сохранения данных на устройстве.Если класс, который я сохраняю, содержит обнуляемый объект, то он выдает следующую ошибку:
"System.ExecutionEngineException: попытка JIT-метода компиляции '(оболочка runtime-invoke): runtime_invoke_void__this ___ Decimal_object_object_Nulla1004 * 1_object_Nullable 1<int>_DateTime_object_object_object_Nullable
1_Nullable 1<DateTime>_Nullable
1_object_object_object_object_object_int_object_object_Nullable 1<int> (object,intptr,intptr,intptr)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.\n\n at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)\n at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:661 \n--- End of stack trace from previous location where exception was thrown ---\n at System.Linq.Expressions.Interp
reter.ExceptionHelpers.UnwrapAndRethrow (System.Reflection.TargetInvocationException exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs:172 \n at System.Linq.Expressions.Interpreter.NewInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00026] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs:39 \n at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63 \n at System.Linq.Expressions.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) [0x0001c] in <41fdc0bc3c7345a
ebac34baf698c1a1e>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry+OriginalValues..ctor (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x00011] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues () [0x0000d] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0000f] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x00094] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState oldState, Mi
crosoft.EntityFrameworkCore.EntityState newState, System.Boolean acceptChanges) [0x00160] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState entityState, System.Boolean acceptChanges, System.Nullable
1 [Т] forceStateWhenUnknownKey) [0x00034] в <6819f4d14a5b46d281e2f19f98f40ca8>: 0 \ п на Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction (Microsoft.EntityFrameworkCore.ChangeTracking.Узел EntityEntryGraphNode, сила System.Boolean) [0x0003f] в <6819f4d14a5b46d281e2f19f98f40ca8>: 0 \ n в (неизвестный упаковщик).EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode узел, состояние TState, System.Func 3[T1,T2,TResult] handleNode) [0x00000] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at (wrapper unknown) System.Object
.gsharedvt_in()\n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry rootEntry, Microsoft.EntityFrameworkCore.EntityState entityState, System.Boolean forceStateWhenUnknownKey) [0x0001b] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.DbContext.SetEntityState (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry, Microsoft.EntityFrameworkCore.EntityState entityState) [0x00013] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.DbContext.SetEntityStates (System.Collections.Generic.IEnumerable
1 [T] сущностей, Microsoft.EntityFrameworkCore.EntityState entityState) [0x00024] в <6819f4d14a5b46d281e2f19f98f40ca8>: 0 \ n в Microsoft.EntityFrameworkCore.DbContext.AddRange (System.Collections.Generic.IEnumerable 1[T] entities) [0x00012] in <6819f4d14a5b46d281e2f19f98f40ca8>:0 \n at Microsoft.EntityFrameworkCore.Internal.Intern
alDbSet
.Anumerable *1009* .E.1010 * 1 [TEntity] .AddRange (System.Collections.Generic.IEnumerable 1[T] entities) [0x0000c] in <19fa30c8b89e4df98a2ac6fb45ffc5ca>:0 \n at myapp.Mobile.Services.FatController+<PerformAction>d__0
1 [T] .MoveNext () [0x001fd] в <9465b9d8d8894975b6d390e6d0a1bc80>: 0 "
1014 * 1014из-за свойств класса, которые он пытается сохранить в хранилище, которые можно обнулять, например:
public class MyTable
{
#region Instance Properties
[Key]
public int MyID { get; set; }
public int? MyNullableID { get; set; }
#endregion Instance Properties
}
Любые идеи, почему это проблема только на устройстве, а не насимулятор или на любых других платформах (UWP, Android работают нормально)?