Will not run on iOS hardware devices
See original GitHub issueDescribe the bug
Build, deploy, and run to an iOS hardware device (ex: iPhone 13) results in the following exception description:
Attempting to JIT compile method '(wrapper delegate-invoke) long <Module>:invoke_callvirt_long_ [...] ' while running in aot-only mode.
EXCEPTION
Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException
at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 154
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitLambda[Func`2](Expression`1 )
at System.Linq.Expressions.Expression`1[[System.Func`2[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor , IArgumentProvider )
at System.Linq.Expressions.ExpressionVisitor.VisitArguments(IArgumentProvider )
at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression )
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.VisitAll(Expression expression, Func`3 visitor) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 57
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.PartiallyEvaluate(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 149
at Microsoft.Datasync.Client.Query.Linq.QueryTranslator`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Translate()
at Microsoft.Datasync.Client.Query.TableQuery`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ToODataString(Boolean includeParameters)
at Microsoft.Datasync.Client.Table.OfflineTable`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].PullItemsAsync[ContainmentVehicle](ITableQuery`1 query, PullOptions options, CancellationToken cancellationToken)
at TMNA.Datasync.Client.Extensions.OfflineTableExtensions.<TryPullItemsAsync>d__0`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
INNER EXCEPTION:
Attempting to JIT compile method ‘(wrapper delegate-invoke) long <Module>:invoke_callvirt_long_Containment (eContainment4.Models.Containment)’ while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
System.ExecutionEngineException
at System.Linq.Expressions.Interpreter.FuncCallInstruction`2[[eContainment4.Models.Containment, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
at System.Dynamic.Utils.DelegateHelpers.FuncThunk[Int64](Func`2 handler)
at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )]
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) long <Module>:invoke_callvirt_long_Containment (eContainment4.Models.Containment)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
at System.Linq.Expressions.Interpreter.FuncCallInstruction`2[[eContainment4.Models.Containment, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
at System.Dynamic.Utils.DelegateHelpers.FuncThunk[Int64](Func`2 handler)
at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 154
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitLambda[Func`2](Expression`1 )
at System.Linq.Expressions.Expression`1[[System.Func`2[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Boolean, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor , IArgumentProvider )
at System.Linq.Expressions.ExpressionVisitor.VisitArguments(IArgumentProvider )
at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression )
at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor )
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression )
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.<Visit>b__5_0(Expression e) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.<>c__DisplayClass5_0.<PartiallyEvaluate>b__0(Expression expr, Func`2 recurse) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 159
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.Visit(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 85
at Microsoft.Datasync.Client.Query.Linq.VisitorHelper.VisitAll(Expression expression, Func`3 visitor) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/VisitorHelper.cs:line 57
at Microsoft.Datasync.Client.Query.Linq.ExpressionExtensions.PartiallyEvaluate(Expression expression) in /Users/ben/Development/Toyota/ECS_Client.Uno.WinUI/Microsoft.Datasync/sdk/dotnet/src/Microsoft.Datasync.Client/Query/Linq/ExpressionExtensions.cs:line 149
at Microsoft.Datasync.Client.Query.Linq.QueryTranslator`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Translate()
at Microsoft.Datasync.Client.Query.TableQuery`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ToODataString(Boolean includeParameters)
at Microsoft.Datasync.Client.Table.OfflineTable`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].PullItemsAsync[ContainmentVehicle](ITableQuery`1 query, PullOptions options, CancellationToken cancellationToken)
at TMNA.Datasync.Client.Extensions.OfflineTableExtensions.<TryPullItemsAsync>d__0`1[[eContainment4.Models.ContainmentVehicle, eContainment4.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
Is this because a number of LINQ extensions methods don’t work with iOS AOT?
- https://stackoverflow.com/questions/16485517/jit-error-with-linq-orderby-using-c-sharp-on-ios
- https://github.com/dotnet/runtime/pull/54970
- https://github.com/dotnet/runtime/issues/55070
- https://github.com/dotnet/runtime/issues/69410
To Reproduce
Steps to reproduce the behavior:
- Build and run app using
IOfflineTable.PullItemsAsync<U>(ITableQuery<U> query, PullOptions options, CancellationToken cancellationToken = default)
- Deploy app to iOS device
- Call
IOfflineTable.PullItemsAsync<U>
- See error
Expected behavior
Library should support iOS AOT as older versions, circa November 2020, did. Broken link to older version of library: https://github.com/Azure/azure-mobile-apps-net-client
What platforms?
- Client : iOS (works great on Android and WinUI)
- .NET Runtime Environment : net7.0-ios
- Library versions: 5.1.0 (commit 8c4ce4a)
- What platform versions are you running on? iOS 16.4
- Does it happen in an emulator / simulator, or only on a real device? Only on real device
Screenshots
n/a
Additional context
Message me if you want a real demo project. It will take a lot work but I believe I can get you one (the real issue is user access).
Issue Analytics
- State:
- Created 7 months ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
The link to the location of the older library is https://github.com/Azure/azure-mobile-apps/tree/archive/azure-mobile-apps-net-client
We have noticed this issue has not been updated within 30 days. If there is no action on this issue in the next 14 days, we will automatically close it.