Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load AOT module (only on published app, not debug) #22081

Open
elias-ik opened this issue Jan 30, 2025 · 0 comments
Open

Failed to load AOT module (only on published app, not debug) #22081

elias-ik opened this issue Jan 30, 2025 · 0 comments

Comments

@elias-ik
Copy link

Apple platform

Mac Catalyst

Framework version

net9.0-*

Affected platform version

.NET 9.0.100

Description

Versions:

Versions: 

Workload version: 9.0.102.1
------------------------------------------
maccatalyst                SDK 9.0.100
maui-maccatalyst           SDK 9.0.100

.NET 9.0.100

XCode: Version 16.2 beta (16B5100e)

sw_vers -productVersion
15.1

When running the app from Rider in Debug, i have no issues running the app.

But when compiling using this script:

Script

#!/bin/bash
echo on
sudo rm -rf CST.Desktop/bin/
sudo dotnet workload restore
echo "Compiling Application"
cd CST.Desktop
dotnet publish -c Release -f net9.0-maccatalyst --self-contained -p:CreatePackage=false -p:GeneratePackageOnBuild=false
cd bin/Release/net9.0-maccatalyst/osx-arm64

It crashes before launch. In the apple console I the error is:
error: Failed to load AOT module 'ZstdSharp' while running in aot-only mode because a dependency cannot be found or it is out of date.

I am not sure if my csproj could be the problem so:

.csproj

<Project Sdk="Microsoft.NET.Sdk.Razor">

    <PropertyGroup>
        <TargetFramework>net9.0-maccatalyst</TargetFramework>
        <DefineConstants Condition="'$(TargetFramework)' == 'net9.0-maccatalyst'">$(DefineConstants);TARGET_OSX</DefineConstants>

        <AotAssemblies>false</AotAssemblies>
        <ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>
        
        <OutputType>Exe</OutputType>
        <RootNamespace>CST.Desktop</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>
        <EnableDefaultCssItems>false</EnableDefaultCssItems>
        <Nullable>enable</Nullable>

        <!-- Display name -->
        <ApplicationTitle>CST BambiSimulatorTool</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.myBambi.CST.desktop</ApplicationId>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.1.2</ApplicationDisplayVersion>
        <ApplicationVersion>3</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
    </PropertyGroup>

    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.png" Color="#512BD4"/>

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128"/>

        <!-- Images -->
        <MauiImage Include="Resources\Images\*"/>
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208"/>

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*"/>

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)"/>

    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="AntDesign" Version="0.20.4.2" />
        <PackageReference Include="BlazorMonaco" Version="3.2.0" />
        <PackageReference Include="Fody" Version="6.8.1">
          <PrivateAssets>all</PrivateAssets>
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
        </PackageReference>
        <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
        <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)"/>
        <PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="$(MauiVersion)"/>
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.2.24473.5" />
        <PackageReference Include="OneOf" Version="3.0.271" />
        <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
    </ItemGroup>

    <ItemGroup>
      <ProjectReference Include="..\CST.Logic\CST.Logic.csproj" />
    </ItemGroup>

    <ItemGroup>
      <AdditionalFiles Include="Components\LogConsole\LogConsole.razor" />
      <AdditionalFiles Include="Components\Pages\BleSimulator\BleDirectSimPage.razor" />
      <AdditionalFiles Include="Components\Pages\HardwareConfigurator\DevicePage.razor" />
      <AdditionalFiles Include="Components\Pages\HardwareConfigurator\Upload.razor" />
    </ItemGroup>

    <ItemGroup>
      <Folder Include="Resources\Images\" />
    </ItemGroup>

</Project>

Steps to Reproduce

Repo can be shared with maintainer in private. Cant reproduce otherwise.

Did you find any workaround?

/

Relevant logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant