question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Starting App on iOS fails with System.ExecutingEngineException

See original GitHub issue

Describe the bug Starting my app on ios (an actual IPad not the simulator, simulator works) fails with the following: (works on Android with AOT)

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283f40bc0 (intptr&,int)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

  at Avalonia.OpenGL.GlBasicInfoInterface.GetStringNative(Int32 v) in /_/src/Avalonia.OpenGL/DevGenerators/Generator.GetProcAddressInitializationGenerator/globalAvalonia.OpenGL.GlBasicInfoInterface.cs:13
  at Avalonia.OpenGL.GlBasicInfoInterface.GetString(Int32 v) in /_/src/Avalonia.OpenGL/GlBasicInfoInterface.cs:27
  at Avalonia.OpenGL.GlBasicInfoInterface.GetExtensions() in /_/src/Avalonia.OpenGL/GlBasicInfoInterface.cs:43
  at Avalonia.OpenGL.GlInterface.GlContextInfo.Create(GlVersion version, Func`2 getProcAddress) in /_/src/Avalonia.OpenGL/GlInterface.cs:33
  at Avalonia.OpenGL.GlInterface..ctor(GlVersion version, Func`2 getProcAddress) in /_/src/Avalonia.OpenGL/GlInterface.cs:48
  at Avalonia.iOS.GlContext..ctor() in /_/src/iOS/Avalonia.iOS/EaglDisplay.cs:30
  at Avalonia.iOS.EaglFeature..ctor() in /_/src/iOS/Avalonia.iOS/EaglDisplay.cs:17
  at Avalonia.iOS.Platform.Register() in /_/src/iOS/Avalonia.iOS/Platform.cs:34
  at at Avalonia.Controls.AppBuilderBase`1[[Avalonia.AppBuilder, Avalonia.Controls, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b]].Setup()
  at at Avalonia.Controls.AppBuilderBase`1[[Avalonia.AppBuilder, Avalonia.Controls, Version=11.0.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b]].SetupWithLifetime(IApplicationLifetime lifetime)
  at at Avalonia.iOS.AvaloniaAppDelegate`1[[MyApp.App, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)

Expected behavior App runs

Desktop:

  • OS: macOS Monterey
  • Version v12.6.1

Here is my project file

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TrimMode>copyused</TrimMode>
    <OutputType>Exe</OutputType>
    <TargetFramework>net7.0-ios</TargetFramework>
    <Nullable>disable</Nullable>
	<SupportedOSPlatformVersion>10.0</SupportedOSPlatformVersion>
	<ProvisioningType>manual</ProvisioningType>
	<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
    <Configurations>Release;Debug</Configurations>
	<CodesignKey>Redacted</CodesignKey>
	<Platforms>AnyCPU;x64</Platforms>
  </PropertyGroup>
  	<ItemGroup>
		<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
		<TrimmableAssembly Include="Avalonia.Themes.Default" />
		<TrimmableAssembly Include="IronPython.Wpf" />
		<TrimmableAssembly Include="IronPython" />
		<TrimmableAssembly Include="IronPython.Modules" />
		<TrimmableAssembly Include="IronPython.SQLite" />
	</ItemGroup>
  <ItemGroup>
    <None Remove=".gitignore" />
  </ItemGroup>
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
		<Optimize>True</Optimize>
		<CreatePackage>false</CreatePackage>
	</PropertyGroup>
	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
		<Optimize>True</Optimize>
		<CreatePackage>false</CreatePackage>
	</PropertyGroup>
	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
	  <CreatePackage>false</CreatePackage>
	  <CodesignProvision>Automatic</CodesignProvision>
	  <MtouchEnableSGenConc>true</MtouchEnableSGenConc>
	</PropertyGroup>
	<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
	  <CreatePackage>false</CreatePackage>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="Microsoft.Net.ILLink.Tasks" Version="8.0.100-1.22612.2" />
		<PackageReference Include="Avalonia.iOS" Version="11.0.0-preview4" />
		<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview4" />
	</ItemGroup>
	<ItemGroup>
		<ProjectReference Include="SomeOtherAppSpecificBusinessLogic" />
	</ItemGroup>
</Project>

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxkatz6commented, Jan 7, 2023

@jhimes144 can you try to build empty xplat template on your machine? Without any dependencies.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Starting App on iOS fails with System. ...
Actual Behavior. The following exception is raised on app startup. System.ExecutionEngineException: Attempting to JIT compile method '(wrapper ...
Read more >
iOS App Store ExecutionEngineException attempting to JIT ...
However, when I submit it to the app store, the feedback is that it crashes on launch on all devices. The crash log...
Read more >
ExecutionEngineException on iOS only
The following exception is only thrown when running the app on iOS hardware (IPad 2, 5.0) ... it works flawlessly on Windows and...
Read more >
Troubleshooting Tips for Xamarin.iOS
This document provides various tips useful for troubleshooting during the development of Xamarin.iOS applications.
Read more >
UWP randomly throwing System.ExecutionEngineException ...
While debugging my UWP apps, I recently started getting this System.ExecutionEngineExeption randomly (roughly 50% of the time) when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found