Starting App on iOS fails with System.ExecutingEngineException #80853

Description

@rolfbjarne

From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

Steps to Reproduce

  1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
  2. Insert needed CodesignKey in project file for the ios project
  3. Build and run the ios project on a physical ios device

Expected Behavior

The app runs

Actual Behavior

The following exception is raised on app startup

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)

I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

Environment

Visual Studio Community 2022 for Mac
Version 17.4.2 (build 17)
Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
Runtime
.NET 6.0.12 (64-bit)
Architecture: X64
Roslyn (Language Service)
4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
NuGet
Version: 6.3.1.1
.NET SDK (x64)
SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
SDK Versions:
7.0.101
6.0.404
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
7.0.1
6.0.12
Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Updater
Version: 11
Xamarin.Android
Version: 13.1.0.1 (Visual Studio Community)
Commit: xamarin-android/d17-4/13ba222
Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
13.0 (API level 33)
SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 32.0.0
Build Information: Mono: a96bde9
Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
SQLite: xamarin/sqlite/3.39.3@23e1ae7
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Android SDK Manager
Version: 17.4.0.54
Hash: 6eabb9e
Branch: remotes/origin/d17-4
Build date: 2022-12-13 04:22:32 UTC
Android Device Manager
Version: 0.0.0.1206
Hash: 886af39
Branch: 886af39
Build date: 2022-12-13 04:22:32 UTC
Apple Developer Tools
Xcode 14.2 (21534)
Build 14C18
Xamarin.Mac
Version: 9.0.0.27 (Visual Studio Community)
Hash: 933c6c2c9
Branch: xcode14.1
Build date: 2022-11-22 02:00:36-0500
Xamarin.iOS
Version: 16.1.1.27 (Visual Studio Community)
Hash: 933c6c2c9
Branch: xcode14.1
Build date: 2022-11-22 02:00:37-0500
Xamarin Designer
Version: 17.4.0.136
Hash: d49c9ff6d3
Branch: remotes/origin/d17-4
Build date: 2022-12-13 04:22:27 UTC
Build Information
Release ID: 1704020017
Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
Build date: 2022-12-13 04:20:10+00
Build branch: release-17.4
Build lane: release-17.4
Operating System
Mac OS X 12.6.1
Darwin 21.6.0 Darwin Kernel Version 21.6.0
Thu Sep 29 20:12:57 PDT 2022
root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64

Copied from original issue dotnet/macios#17159

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
     blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
    }
    } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
    })();
    (function(){
    try {
    var __m = "github.com";
    var __re = new RegExp('^' + "github\\.com" + '
    
    Skip to content

    Starting App on iOS fails with System.ExecutingEngineException #80853

    Description

    @rolfbjarne

    From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

    This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
    To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

    Steps to Reproduce

    1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
    2. Insert needed CodesignKey in project file for the ios project
    3. Build and run the ios project on a physical ios device

    Expected Behavior

    The app runs

    Actual Behavior

    The following exception is raised on app startup

    System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    

    I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

    Environment

    Visual Studio Community 2022 for Mac
    Version 17.4.2 (build 17)
    Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
    Runtime
    .NET 6.0.12 (64-bit)
    Architecture: X64
    Roslyn (Language Service)
    4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
    NuGet
    Version: 6.3.1.1
    .NET SDK (x64)
    SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
    SDK Versions:
    7.0.101
    6.0.404
    MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
    .NET Runtime (x64)
    Runtime: /usr/local/share/dotnet/dotnet
    Runtime Versions:
    7.0.1
    6.0.12
    Xamarin.Profiler
    Version: 1.8.0.19
    Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
    Updater
    Version: 11
    Xamarin.Android
    Version: 13.1.0.1 (Visual Studio Community)
    Commit: xamarin-android/d17-4/13ba222
    Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
    13.0 (API level 33)
    SDK Command-line Tools Version: 7.0
    SDK Platform Tools Version: 33.0.2
    SDK Build Tools Version: 32.0.0
    Build Information: Mono: a96bde9
    Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
    SQLite: xamarin/sqlite/3.39.3@23e1ae7
    Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
    Microsoft Build of OpenJDK
    Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
    11.0.12
    Android Designer EPL code available here:
    https://github.com/xamarin/AndroidDesigner.EPL
    Eclipse Temurin JDK
    Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
    1.8.0.302
    Android Designer EPL code available here:
    https://github.com/xamarin/AndroidDesigner.EPL
    Android SDK Manager
    Version: 17.4.0.54
    Hash: 6eabb9e
    Branch: remotes/origin/d17-4
    Build date: 2022-12-13 04:22:32 UTC
    Android Device Manager
    Version: 0.0.0.1206
    Hash: 886af39
    Branch: 886af39
    Build date: 2022-12-13 04:22:32 UTC
    Apple Developer Tools
    Xcode 14.2 (21534)
    Build 14C18
    Xamarin.Mac
    Version: 9.0.0.27 (Visual Studio Community)
    Hash: 933c6c2c9
    Branch: xcode14.1
    Build date: 2022-11-22 02:00:36-0500
    Xamarin.iOS
    Version: 16.1.1.27 (Visual Studio Community)
    Hash: 933c6c2c9
    Branch: xcode14.1
    Build date: 2022-11-22 02:00:37-0500
    Xamarin Designer
    Version: 17.4.0.136
    Hash: d49c9ff6d3
    Branch: remotes/origin/d17-4
    Build date: 2022-12-13 04:22:27 UTC
    Build Information
    Release ID: 1704020017
    Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
    Build date: 2022-12-13 04:20:10+00
    Build branch: release-17.4
    Build lane: release-17.4
    Operating System
    Mac OS X 12.6.1
    Darwin 21.6.0 Darwin Kernel Version 21.6.0
    Thu Sep 29 20:12:57 PDT 2022
    root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
    

    Copied from original issue dotnet/macios#17159

    Metadata

    Metadata

    Assignees

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
      Skip to content

      Starting App on iOS fails with System.ExecutingEngineException #80853

      Description

      @rolfbjarne

      From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

      This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
      To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

      Steps to Reproduce

      1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
      2. Insert needed CodesignKey in project file for the ios project
      3. Build and run the ios project on a physical ios device

      Expected Behavior

      The app runs

      Actual Behavior

      The following exception is raised on app startup

      System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
      

      I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

      Environment

      Visual Studio Community 2022 for Mac
      Version 17.4.2 (build 17)
      Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
      Runtime
      .NET 6.0.12 (64-bit)
      Architecture: X64
      Roslyn (Language Service)
      4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
      NuGet
      Version: 6.3.1.1
      .NET SDK (x64)
      SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
      SDK Versions:
      7.0.101
      6.0.404
      MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
      .NET Runtime (x64)
      Runtime: /usr/local/share/dotnet/dotnet
      Runtime Versions:
      7.0.1
      6.0.12
      Xamarin.Profiler
      Version: 1.8.0.19
      Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
      Updater
      Version: 11
      Xamarin.Android
      Version: 13.1.0.1 (Visual Studio Community)
      Commit: xamarin-android/d17-4/13ba222
      Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
      Supported Android versions:
      13.0 (API level 33)
      SDK Command-line Tools Version: 7.0
      SDK Platform Tools Version: 33.0.2
      SDK Build Tools Version: 32.0.0
      Build Information: Mono: a96bde9
      Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
      SQLite: xamarin/sqlite/3.39.3@23e1ae7
      Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
      Microsoft Build of OpenJDK
      Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
      11.0.12
      Android Designer EPL code available here:
      https://github.com/xamarin/AndroidDesigner.EPL
      Eclipse Temurin JDK
      Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
      1.8.0.302
      Android Designer EPL code available here:
      https://github.com/xamarin/AndroidDesigner.EPL
      Android SDK Manager
      Version: 17.4.0.54
      Hash: 6eabb9e
      Branch: remotes/origin/d17-4
      Build date: 2022-12-13 04:22:32 UTC
      Android Device Manager
      Version: 0.0.0.1206
      Hash: 886af39
      Branch: 886af39
      Build date: 2022-12-13 04:22:32 UTC
      Apple Developer Tools
      Xcode 14.2 (21534)
      Build 14C18
      Xamarin.Mac
      Version: 9.0.0.27 (Visual Studio Community)
      Hash: 933c6c2c9
      Branch: xcode14.1
      Build date: 2022-11-22 02:00:36-0500
      Xamarin.iOS
      Version: 16.1.1.27 (Visual Studio Community)
      Hash: 933c6c2c9
      Branch: xcode14.1
      Build date: 2022-11-22 02:00:37-0500
      Xamarin Designer
      Version: 17.4.0.136
      Hash: d49c9ff6d3
      Branch: remotes/origin/d17-4
      Build date: 2022-12-13 04:22:27 UTC
      Build Information
      Release ID: 1704020017
      Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
      Build date: 2022-12-13 04:20:10+00
      Build branch: release-17.4
      Build lane: release-17.4
      Operating System
      Mac OS X 12.6.1
      Darwin 21.6.0 Darwin Kernel Version 21.6.0
      Thu Sep 29 20:12:57 PDT 2022
      root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
      

      Copied from original issue dotnet/macios#17159

      Metadata

      Metadata

      Assignees

      Type

      No type

      Projects

      No projects

        Milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
        Skip to content

        Starting App on iOS fails with System.ExecutingEngineException #80853

        Description

        @rolfbjarne

        From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

        This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
        To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

        Steps to Reproduce

        1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
        2. Insert needed CodesignKey in project file for the ios project
        3. Build and run the ios project on a physical ios device

        Expected Behavior

        The app runs

        Actual Behavior

        The following exception is raised on app startup

        System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        

        I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

        Environment

        Visual Studio Community 2022 for Mac
        Version 17.4.2 (build 17)
        Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
        Runtime
        .NET 6.0.12 (64-bit)
        Architecture: X64
        Roslyn (Language Service)
        4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
        NuGet
        Version: 6.3.1.1
        .NET SDK (x64)
        SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
        SDK Versions:
        7.0.101
        6.0.404
        MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
        .NET Runtime (x64)
        Runtime: /usr/local/share/dotnet/dotnet
        Runtime Versions:
        7.0.1
        6.0.12
        Xamarin.Profiler
        Version: 1.8.0.19
        Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
        Updater
        Version: 11
        Xamarin.Android
        Version: 13.1.0.1 (Visual Studio Community)
        Commit: xamarin-android/d17-4/13ba222
        Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
        Supported Android versions:
        13.0 (API level 33)
        SDK Command-line Tools Version: 7.0
        SDK Platform Tools Version: 33.0.2
        SDK Build Tools Version: 32.0.0
        Build Information: Mono: a96bde9
        Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
        SQLite: xamarin/sqlite/3.39.3@23e1ae7
        Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
        Microsoft Build of OpenJDK
        Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
        11.0.12
        Android Designer EPL code available here:
        https://github.com/xamarin/AndroidDesigner.EPL
        Eclipse Temurin JDK
        Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
        1.8.0.302
        Android Designer EPL code available here:
        https://github.com/xamarin/AndroidDesigner.EPL
        Android SDK Manager
        Version: 17.4.0.54
        Hash: 6eabb9e
        Branch: remotes/origin/d17-4
        Build date: 2022-12-13 04:22:32 UTC
        Android Device Manager
        Version: 0.0.0.1206
        Hash: 886af39
        Branch: 886af39
        Build date: 2022-12-13 04:22:32 UTC
        Apple Developer Tools
        Xcode 14.2 (21534)
        Build 14C18
        Xamarin.Mac
        Version: 9.0.0.27 (Visual Studio Community)
        Hash: 933c6c2c9
        Branch: xcode14.1
        Build date: 2022-11-22 02:00:36-0500
        Xamarin.iOS
        Version: 16.1.1.27 (Visual Studio Community)
        Hash: 933c6c2c9
        Branch: xcode14.1
        Build date: 2022-11-22 02:00:37-0500
        Xamarin Designer
        Version: 17.4.0.136
        Hash: d49c9ff6d3
        Branch: remotes/origin/d17-4
        Build date: 2022-12-13 04:22:27 UTC
        Build Information
        Release ID: 1704020017
        Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
        Build date: 2022-12-13 04:20:10+00
        Build branch: release-17.4
        Build lane: release-17.4
        Operating System
        Mac OS X 12.6.1
        Darwin 21.6.0 Darwin Kernel Version 21.6.0
        Thu Sep 29 20:12:57 PDT 2022
        root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
        

        Copied from original issue dotnet/macios#17159

        Metadata

        Metadata

        Assignees

        Type

        No type

        Projects

        No projects

          Milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
          Skip to content

          Starting App on iOS fails with System.ExecutingEngineException #80853

          Description

          @rolfbjarne

          From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

          This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
          To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

          Steps to Reproduce

          1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
          2. Insert needed CodesignKey in project file for the ios project
          3. Build and run the ios project on a physical ios device

          Expected Behavior

          The app runs

          Actual Behavior

          The following exception is raised on app startup

          System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
          

          I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

          Environment

          Visual Studio Community 2022 for Mac
          Version 17.4.2 (build 17)
          Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
          Runtime
          .NET 6.0.12 (64-bit)
          Architecture: X64
          Roslyn (Language Service)
          4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
          NuGet
          Version: 6.3.1.1
          .NET SDK (x64)
          SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
          SDK Versions:
          7.0.101
          6.0.404
          MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
          .NET Runtime (x64)
          Runtime: /usr/local/share/dotnet/dotnet
          Runtime Versions:
          7.0.1
          6.0.12
          Xamarin.Profiler
          Version: 1.8.0.19
          Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
          Updater
          Version: 11
          Xamarin.Android
          Version: 13.1.0.1 (Visual Studio Community)
          Commit: xamarin-android/d17-4/13ba222
          Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
          Supported Android versions:
          13.0 (API level 33)
          SDK Command-line Tools Version: 7.0
          SDK Platform Tools Version: 33.0.2
          SDK Build Tools Version: 32.0.0
          Build Information: Mono: a96bde9
          Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
          SQLite: xamarin/sqlite/3.39.3@23e1ae7
          Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
          Microsoft Build of OpenJDK
          Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
          11.0.12
          Android Designer EPL code available here:
          https://github.com/xamarin/AndroidDesigner.EPL
          Eclipse Temurin JDK
          Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
          1.8.0.302
          Android Designer EPL code available here:
          https://github.com/xamarin/AndroidDesigner.EPL
          Android SDK Manager
          Version: 17.4.0.54
          Hash: 6eabb9e
          Branch: remotes/origin/d17-4
          Build date: 2022-12-13 04:22:32 UTC
          Android Device Manager
          Version: 0.0.0.1206
          Hash: 886af39
          Branch: 886af39
          Build date: 2022-12-13 04:22:32 UTC
          Apple Developer Tools
          Xcode 14.2 (21534)
          Build 14C18
          Xamarin.Mac
          Version: 9.0.0.27 (Visual Studio Community)
          Hash: 933c6c2c9
          Branch: xcode14.1
          Build date: 2022-11-22 02:00:36-0500
          Xamarin.iOS
          Version: 16.1.1.27 (Visual Studio Community)
          Hash: 933c6c2c9
          Branch: xcode14.1
          Build date: 2022-11-22 02:00:37-0500
          Xamarin Designer
          Version: 17.4.0.136
          Hash: d49c9ff6d3
          Branch: remotes/origin/d17-4
          Build date: 2022-12-13 04:22:27 UTC
          Build Information
          Release ID: 1704020017
          Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
          Build date: 2022-12-13 04:20:10+00
          Build branch: release-17.4
          Build lane: release-17.4
          Operating System
          Mac OS X 12.6.1
          Darwin 21.6.0 Darwin Kernel Version 21.6.0
          Thu Sep 29 20:12:57 PDT 2022
          root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
          

          Copied from original issue dotnet/macios#17159

          Metadata

          Metadata

          Assignees

          Type

          No type

          Projects

          No projects

            Milestone

            Relationships

            None yet

            Development

            No branches or pull requests

            Issue actions

            , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
            Skip to content

            Starting App on iOS fails with System.ExecutingEngineException #80853

            Description

            @rolfbjarne

            From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

            This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
            To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

            Steps to Reproduce

            1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
            2. Insert needed CodesignKey in project file for the ios project
            3. Build and run the ios project on a physical ios device

            Expected Behavior

            The app runs

            Actual Behavior

            The following exception is raised on app startup

            System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
            

            I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

            Environment

            Visual Studio Community 2022 for Mac
            Version 17.4.2 (build 17)
            Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
            Runtime
            .NET 6.0.12 (64-bit)
            Architecture: X64
            Roslyn (Language Service)
            4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
            NuGet
            Version: 6.3.1.1
            .NET SDK (x64)
            SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
            SDK Versions:
            7.0.101
            6.0.404
            MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
            .NET Runtime (x64)
            Runtime: /usr/local/share/dotnet/dotnet
            Runtime Versions:
            7.0.1
            6.0.12
            Xamarin.Profiler
            Version: 1.8.0.19
            Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
            Updater
            Version: 11
            Xamarin.Android
            Version: 13.1.0.1 (Visual Studio Community)
            Commit: xamarin-android/d17-4/13ba222
            Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
            Supported Android versions:
            13.0 (API level 33)
            SDK Command-line Tools Version: 7.0
            SDK Platform Tools Version: 33.0.2
            SDK Build Tools Version: 32.0.0
            Build Information: Mono: a96bde9
            Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
            SQLite: xamarin/sqlite/3.39.3@23e1ae7
            Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
            Microsoft Build of OpenJDK
            Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
            11.0.12
            Android Designer EPL code available here:
            https://github.com/xamarin/AndroidDesigner.EPL
            Eclipse Temurin JDK
            Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
            1.8.0.302
            Android Designer EPL code available here:
            https://github.com/xamarin/AndroidDesigner.EPL
            Android SDK Manager
            Version: 17.4.0.54
            Hash: 6eabb9e
            Branch: remotes/origin/d17-4
            Build date: 2022-12-13 04:22:32 UTC
            Android Device Manager
            Version: 0.0.0.1206
            Hash: 886af39
            Branch: 886af39
            Build date: 2022-12-13 04:22:32 UTC
            Apple Developer Tools
            Xcode 14.2 (21534)
            Build 14C18
            Xamarin.Mac
            Version: 9.0.0.27 (Visual Studio Community)
            Hash: 933c6c2c9
            Branch: xcode14.1
            Build date: 2022-11-22 02:00:36-0500
            Xamarin.iOS
            Version: 16.1.1.27 (Visual Studio Community)
            Hash: 933c6c2c9
            Branch: xcode14.1
            Build date: 2022-11-22 02:00:37-0500
            Xamarin Designer
            Version: 17.4.0.136
            Hash: d49c9ff6d3
            Branch: remotes/origin/d17-4
            Build date: 2022-12-13 04:22:27 UTC
            Build Information
            Release ID: 1704020017
            Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
            Build date: 2022-12-13 04:20:10+00
            Build branch: release-17.4
            Build lane: release-17.4
            Operating System
            Mac OS X 12.6.1
            Darwin 21.6.0 Darwin Kernel Version 21.6.0
            Thu Sep 29 20:12:57 PDT 2022
            root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
            

            Copied from original issue dotnet/macios#17159

            Metadata

            Metadata

            Assignees

            Type

            No type

            Projects

            No projects

              Milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
              Skip to content

              Starting App on iOS fails with System.ExecutingEngineException #80853

              Description

              @rolfbjarne

              From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

              This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
              To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

              Steps to Reproduce

              1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
              2. Insert needed CodesignKey in project file for the ios project
              3. Build and run the ios project on a physical ios device

              Expected Behavior

              The app runs

              Actual Behavior

              The following exception is raised on app startup

              System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
              

              I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

              Environment

              Visual Studio Community 2022 for Mac
              Version 17.4.2 (build 17)
              Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
              Runtime
              .NET 6.0.12 (64-bit)
              Architecture: X64
              Roslyn (Language Service)
              4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
              NuGet
              Version: 6.3.1.1
              .NET SDK (x64)
              SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
              SDK Versions:
              7.0.101
              6.0.404
              MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
              .NET Runtime (x64)
              Runtime: /usr/local/share/dotnet/dotnet
              Runtime Versions:
              7.0.1
              6.0.12
              Xamarin.Profiler
              Version: 1.8.0.19
              Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
              Updater
              Version: 11
              Xamarin.Android
              Version: 13.1.0.1 (Visual Studio Community)
              Commit: xamarin-android/d17-4/13ba222
              Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
              Supported Android versions:
              13.0 (API level 33)
              SDK Command-line Tools Version: 7.0
              SDK Platform Tools Version: 33.0.2
              SDK Build Tools Version: 32.0.0
              Build Information: Mono: a96bde9
              Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
              SQLite: xamarin/sqlite/3.39.3@23e1ae7
              Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
              Microsoft Build of OpenJDK
              Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
              11.0.12
              Android Designer EPL code available here:
              https://github.com/xamarin/AndroidDesigner.EPL
              Eclipse Temurin JDK
              Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
              1.8.0.302
              Android Designer EPL code available here:
              https://github.com/xamarin/AndroidDesigner.EPL
              Android SDK Manager
              Version: 17.4.0.54
              Hash: 6eabb9e
              Branch: remotes/origin/d17-4
              Build date: 2022-12-13 04:22:32 UTC
              Android Device Manager
              Version: 0.0.0.1206
              Hash: 886af39
              Branch: 886af39
              Build date: 2022-12-13 04:22:32 UTC
              Apple Developer Tools
              Xcode 14.2 (21534)
              Build 14C18
              Xamarin.Mac
              Version: 9.0.0.27 (Visual Studio Community)
              Hash: 933c6c2c9
              Branch: xcode14.1
              Build date: 2022-11-22 02:00:36-0500
              Xamarin.iOS
              Version: 16.1.1.27 (Visual Studio Community)
              Hash: 933c6c2c9
              Branch: xcode14.1
              Build date: 2022-11-22 02:00:37-0500
              Xamarin Designer
              Version: 17.4.0.136
              Hash: d49c9ff6d3
              Branch: remotes/origin/d17-4
              Build date: 2022-12-13 04:22:27 UTC
              Build Information
              Release ID: 1704020017
              Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
              Build date: 2022-12-13 04:20:10+00
              Build branch: release-17.4
              Build lane: release-17.4
              Operating System
              Mac OS X 12.6.1
              Darwin 21.6.0 Darwin Kernel Version 21.6.0
              Thu Sep 29 20:12:57 PDT 2022
              root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
              

              Copied from original issue dotnet/macios#17159

              Metadata

              Metadata

              Assignees

              Type

              No type

              Projects

              No projects

                Milestone

                Relationships

                None yet

                Development

                No branches or pull requests

                Issue actions

                , 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
                Skip to content

                Starting App on iOS fails with System.ExecutingEngineException #80853

                Description

                @rolfbjarne

                From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT

                This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
                To the best of our knowledge, the below method GetStringNative should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.

                Steps to Reproduce

                1. Create a new dotnet solution using the Avalonia xplat template. See https://github.com/AvaloniaUI/avalonia-dotnet-templates
                2. Insert needed CodesignKey in project file for the ios project
                3. Build and run the ios project on a physical ios device

                Expected Behavior

                The app runs

                Actual Behavior

                The following exception is raised on app startup

                System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) intptr Avalonia.OpenGL.GlBasicInfoInterface:wrapper_native_indirect_0x283931e40 (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[[testapp.App, testapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].FinishedLaunching(UIApplication application, NSDictionary launchOptions)
                

                I have tried adding <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.

                Environment

                Visual Studio Community 2022 for Mac
                Version 17.4.2 (build 17)
                Installation UUID: 04eb36b5-8ade-4881-9f2c-f51e231033e1
                Runtime
                .NET 6.0.12 (64-bit)
                Architecture: X64
                Roslyn (Language Service)
                4.4.0-6.22578.12+3c6ab8e1715e5b080fb7bb77070810ab71e09387
                NuGet
                Version: 6.3.1.1
                .NET SDK (x64)
                SDK: /usr/local/share/dotnet/sdk/7.0.101/Sdks
                SDK Versions:
                7.0.101
                6.0.404
                MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks
                .NET Runtime (x64)
                Runtime: /usr/local/share/dotnet/dotnet
                Runtime Versions:
                7.0.1
                6.0.12
                Xamarin.Profiler
                Version: 1.8.0.19
                Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
                Updater
                Version: 11
                Xamarin.Android
                Version: 13.1.0.1 (Visual Studio Community)
                Commit: xamarin-android/d17-4/13ba222
                Android SDK: /Users/jhimes/Library/Developer/Xamarin/android-sdk-macosx
                Supported Android versions:
                13.0 (API level 33)
                SDK Command-line Tools Version: 7.0
                SDK Platform Tools Version: 33.0.2
                SDK Build Tools Version: 32.0.0
                Build Information: Mono: a96bde9
                Java.Interop: xamarin/java.interop/d17-4@fcc33ce2
                SQLite: xamarin/sqlite/3.39.3@23e1ae7
                Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a
                Microsoft Build of OpenJDK
                Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
                11.0.12
                Android Designer EPL code available here:
                https://github.com/xamarin/AndroidDesigner.EPL
                Eclipse Temurin JDK
                Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
                1.8.0.302
                Android Designer EPL code available here:
                https://github.com/xamarin/AndroidDesigner.EPL
                Android SDK Manager
                Version: 17.4.0.54
                Hash: 6eabb9e
                Branch: remotes/origin/d17-4
                Build date: 2022-12-13 04:22:32 UTC
                Android Device Manager
                Version: 0.0.0.1206
                Hash: 886af39
                Branch: 886af39
                Build date: 2022-12-13 04:22:32 UTC
                Apple Developer Tools
                Xcode 14.2 (21534)
                Build 14C18
                Xamarin.Mac
                Version: 9.0.0.27 (Visual Studio Community)
                Hash: 933c6c2c9
                Branch: xcode14.1
                Build date: 2022-11-22 02:00:36-0500
                Xamarin.iOS
                Version: 16.1.1.27 (Visual Studio Community)
                Hash: 933c6c2c9
                Branch: xcode14.1
                Build date: 2022-11-22 02:00:37-0500
                Xamarin Designer
                Version: 17.4.0.136
                Hash: d49c9ff6d3
                Branch: remotes/origin/d17-4
                Build date: 2022-12-13 04:22:27 UTC
                Build Information
                Release ID: 1704020017
                Git revision: 7ef5413f2eec3351ce648085f619fc29fd8cb647
                Build date: 2022-12-13 04:20:10+00
                Build branch: release-17.4
                Build lane: release-17.4
                Operating System
                Mac OS X 12.6.1
                Darwin 21.6.0 Darwin Kernel Version 21.6.0
                Thu Sep 29 20:12:57 PDT 2022
                root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
                

                Copied from original issue dotnet/macios#17159

                Metadata

                Metadata

                Assignees

                Type

                No type

                Projects

                No projects

                  Milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions