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

Two MacCatalyst RIDs can cause error : Unable to merge the file 'Contents/Resources/Assets.car' #16065

Closed
jonathanpeppers opened this issue Sep 21, 2022 · 3 comments · Fixed by #16089
Labels
dotnet An issue or pull request related to .NET (6) feature A feature to be implemented
Milestone

Comments

@jonathanpeppers
Copy link
Member

Steps to Reproduce

  1. build a MAUI app targeting MacCatalyst with RuntimeIdentifiers=maccatalyst-x64;maccatalyst-arm64
  2. sometimes it fails with errors like:
/Users/runner/.dotnet/packs/Microsoft.MacCatalyst.Sdk/15.4.454/targets/Xamarin.Shared.Sdk.targets(371,3): error : Unable to merge the file 'Contents/Resources/Assets.car', it's different between the input app bundles. [/Users/runner/work/inclusive-code-reviews-ml/inclusive-code-reviews-ml/Maui/MLTrainer/MLTrainer.csproj]
/Users/runner/.dotnet/packs/Microsoft.MacCatalyst.Sdk/15.4.454/targets/Xamarin.Shared.Sdk.targets(371,3): error : App bundle file #1: /Users/runner/work/inclusive-code-reviews-ml/inclusive-code-reviews-ml/Maui/MLTrainer/bin/Release/net6.0-maccatalyst/maccatalyst-x64/MLTrainer.app/Contents/Resources/Assets.car [/Users/runner/work/inclusive-code-reviews-ml/inclusive-code-reviews-ml/Maui/MLTrainer/MLTrainer.csproj]
/Users/runner/.dotnet/packs/Microsoft.MacCatalyst.Sdk/15.4.454/targets/Xamarin.Shared.Sdk.targets(371,3): error : App bundle file #2: /Users/runner/work/inclusive-code-reviews-ml/inclusive-code-reviews-ml/Maui/MLTrainer/bin/Release/net6.0-maccatalyst/maccatalyst-arm64/MLTrainer.app/Contents/Resources/Assets.car 

My rough estimate is that this fails on GitHub actions around 1 in 10 tries. I think we also saw it on MAUI's CI here: dotnet/maui#9968 (comment)

Expected Behavior

RuntimeIdentifiers=maccatalyst-x64;maccatalyst-arm64 doesn't fail the build.

Actual Behavior

RuntimeIdentifiers=maccatalyst-x64;maccatalyst-arm64 sometimes fails the build.

Environment

CI reported these versions:

dotnet-install: .NET Core SDK with version '6.0.401' is already installed.
...
Run dotnet workload install maui-desktop --ignore-failed-sources

Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Installing workload manifest microsoft.net.sdk.android version 32.0.465…
Installing workload manifest microsoft.net.sdk.ios version 15.4.454…
Installing workload manifest microsoft.net.sdk.maccatalyst version 15.4.454…
Installing workload manifest microsoft.net.sdk.macos version 12.3.454…
Installing workload manifest microsoft.net.sdk.maui version 6.0.540…
Installing workload manifest microsoft.net.sdk.tvos version 15.4.454…
Installing workload manifest microsoft.net.workload.mono.toolchain version 6.0.9…
Installing workload manifest microsoft.net.workload.emscripten version 6.0.9…
Installing pack Microsoft.Maui.Core.Ref.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.maccatalyst version 6.0.540...
Installing pack Microsoft.Maui.Core.Runtime.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.maccatalyst version 6.0.540...
Installing pack Microsoft.Maui.Controls.Ref.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.maccatalyst version 6.0.540...
Installing pack Microsoft.Maui.Controls.Runtime.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.maccatalyst version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Ref.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.maccatalyst version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Runtime.maccatalyst version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.maccatalyst version 6.0.540...
Installing pack Microsoft.AspNetCore.Components.WebView.Maui version 6.0.540...
Writing workload pack installation record for Microsoft.AspNetCore.Components.WebView.Maui version 6.0.540...
Installing pack Microsoft.Maui.Dependencies version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Dependencies version 6.0.540...
Installing pack Microsoft.Maui.Sdk version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Sdk.net6 version 6.0.540...
Installing pack Microsoft.Maui.Extensions version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Extensions version 6.0.540...
Installing pack Microsoft.Maui.Graphics version 6.0.501...
Writing workload pack installation record for Microsoft.Maui.Graphics version 6.0.501...
Installing pack Microsoft.Maui.Resizetizer.Sdk version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Resizetizer.Sdk version 6.0.540...
Installing pack Microsoft.Maui.Templates.net6 version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Templates.net6 version 6.0.540...
Installing pack Microsoft.Maui.Core.Ref.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.any version 6.0.540...
Installing pack Microsoft.Maui.Core.Runtime.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.any version 6.0.540...
Installing pack Microsoft.Maui.Controls.Ref.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.any version 6.0.540...
Installing pack Microsoft.Maui.Controls.Runtime.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.any version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Ref.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.any version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Runtime.any version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.any version 6.0.540...
Installing pack Microsoft.MacCatalyst.Sdk version 15.4.454...
Writing workload pack installation record for Microsoft.MacCatalyst.Sdk.net6 version 15.4.454...
Installing pack Microsoft.MacCatalyst.Ref version 15.4.454...
Writing workload pack installation record for Microsoft.MacCatalyst.Ref version 15.4.454...
Installing pack Microsoft.MacCatalyst.Runtime.maccatalyst-arm64 version 15.4.454...
Writing workload pack installation record for Microsoft.MacCatalyst.Runtime.maccatalyst-arm64 version 15.4.454...
Installing pack Microsoft.MacCatalyst.Runtime.maccatalyst-x64 version 15.4.454...
Writing workload pack installation record for Microsoft.MacCatalyst.Runtime.maccatalyst-x64 version 15.4.454...
Installing pack Microsoft.MacCatalyst.Templates version 15.4.454...
Writing workload pack installation record for Microsoft.MacCatalyst.Templates version 15.4.454...
Installing pack Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-arm64 version 6.0.9...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.maccatalyst-arm64 version 6.0.9...
Installing pack Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.maccatalyst-x64 version 6.0.9...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.maccatalyst-x64 version 6.0.9...
Installing pack Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64 version 6.0.9...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.maccatalyst-arm64 version 6.0.9...
Installing pack Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64 version 6.0.9...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.maccatalyst-x64 version 6.0.9...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.9...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.9...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk version 6.0.9...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.9...
Installing pack Microsoft.Maui.Core.Ref.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.win version 6.0.540...
Installing pack Microsoft.Maui.Core.Runtime.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.win version 6.0.540...
Installing pack Microsoft.Maui.Controls.Ref.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.win version 6.0.540...
Installing pack Microsoft.Maui.Controls.Runtime.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.win version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Ref.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.win version 6.0.540...
Installing pack Microsoft.Maui.Essentials.Runtime.win version 6.0.540...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.win version 6.0.540...
Installing pack Microsoft.Maui.Graphics.Win2D.WinUI.Desktop version 6.0.501...
Writing workload pack installation record for Microsoft.Maui.Graphics.Win2D.WinUI.Desktop version 6.0.501...
Garbage collecting for SDK feature band(s) 6.0.400...

Successfully installed workload(s) maui-desktop.

Build Logs

This happened here: https://github.com/jonathanpeppers/inclusive-code-reviews-ml/actions/runs/3101122438/jobs/5022151673

logs.zip

Example Project (If Possible)

Using this project:

https://github.com/jonathanpeppers/inclusive-code-reviews-ml/tree/main/Maui/MLTrainer

@jonathanpeppers jonathanpeppers added the dotnet An issue or pull request related to .NET (6) label Sep 21, 2022
@jonathanpeppers
Copy link
Member Author

If you look here, you can get an idea of the frequency:

https://github.com/jonathanpeppers/inclusive-code-reviews-ml/commits/main

The two recent "red" GitHub statuses are this issue.

@rolfbjarne
Copy link
Member

It's the same thing as this: dotnet/maui#9968 (comment)

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Sep 22, 2022
…amarin#16065.

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes xamarin#16065.
@rolfbjarne
Copy link
Member

I'm adding a public MSBuild property that MAUI can hook into instead of using private targets.

I've also created a MAUI issue to have them update their code: dotnet/maui#10272

@rolfbjarne rolfbjarne added the feature A feature to be implemented label Sep 22, 2022
@rolfbjarne rolfbjarne added this to the .NET 7 milestone Sep 22, 2022
rolfbjarne added a commit that referenced this issue Sep 23, 2022
…16065. (#16089)

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes #16065.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Sep 23, 2022
…amarin#16065.

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes xamarin#16065.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Sep 23, 2022
…amarin#16065.

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes xamarin#16065.
rolfbjarne added a commit that referenced this issue Sep 23, 2022
…etsDependsOn' property. Fixes #16065. (#16111)

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes #16065.

Backport of #16089

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
dalexsoto pushed a commit that referenced this issue Sep 26, 2022
…dsOn' property. Fixes #16065. (#16112)

Add a public 'CompileImageAssetsDependsOn' property, so that MAUI can
inject tasks that
must be completed before we compile image assets:

```xml
<PropertyGroup>
	<CompileImageAssetsDependsOn>
		$(CompileImageAssetsDependsOn);
		ResizetizeCollectItems;
	</CompileImageAssetsDependsOn>
</PropertyGroup>
```

Fixes #16065.


Backport of #16089

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dotnet An issue or pull request related to .NET (6) feature A feature to be implemented
Projects
None yet
2 participants