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

The SDK Microsoft.NET.Runtime.MonoAOTCompiler.Task could not be found. #9176

Open
gmck opened this issue Aug 7, 2024 · 9 comments
Open

The SDK Microsoft.NET.Runtime.MonoAOTCompiler.Task could not be found. #9176

gmck opened this issue Aug 7, 2024 · 9 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review

Comments

@gmck
Copy link

gmck commented Aug 7, 2024

Android framework version

net8.0-android

Affected platform version

VS 2022 17.10.5

Description

When I try and clone the GitHub repo of my app on a second machine I always get the above error. The same thing happens if I download it as a zip. The file exists at C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\targets\Microsoft.Android.Sdk.Aot.targets. Tried with VS preview versions as well and the same problem.

The app builds fine on my machine. I've deleted the repo and recreated it and it still fails

Steps to Reproduce

As above

Did you find any workaround?

No

Relevant log output

n/a
@gmck gmck added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Aug 7, 2024
@dellis1972
Copy link
Contributor

Do you have a binlog?

Have you tried clearing the nuget cache? A quick google search suggests that might help.

@dellis1972 dellis1972 added need-info Issues that need more information from the author. and removed needs-triage Issues that need to be assigned. labels Aug 7, 2024
@gmck
Copy link
Author

gmck commented Aug 7, 2024

bin_gmck.zip
@dellis1972 This build is ok with VS on my main machine.

I tried building on my machine where I haven't had any problems building using VS. So I tried VS Code terminal with dotnet build OBDNowPros.csproj -bl and got the same error. This was after I had used Clear All NuGet Storage and rebuilt with VS. After the Nuget stuff I also got the same error rebuilding. Cleaned again and it was rebuilt correctly as above.

A quick google search suggests that might help. Didn't help me when I searched.

@dotnet-policy-service dotnet-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Aug 7, 2024
@dellis1972
Copy link
Contributor

@gmck the only way I can repo you issue is it I don't have the following in the project. (this is when building for release)

<RunAOTCompilation>true</RunAOTCompilation>

@jonathanpeppers
Copy link
Member

Microsoft.NET.Runtime.MonoAOTCompiler.Task is part of the Mono workload that the Android workload depends on.

If this only happens on one machine, it's probably related to .NET workloads having some install failure.

If you follow this to get your machine to a clean state:

Then install the .NET MAUI workload in Visual Studio again, does the problem go away?

@gmck
Copy link
Author

gmck commented Aug 7, 2024

@dellis1972 I have that true because I'm trying to use dotnet trace to collect a speedscope file - following Jonathon's video. I first hit this performance problem about a year ago see #8285. I gave up on net8.0-android back then and went back to X.A. to get my app (Android 14) into production. Now I'm back converting it to net8.0-android and the performance is just as bad as it was last year.

@jonathanpeppers - I'm not interested in Maui, only Android, so do you still want me to do all that maui stuff?

@jonathanpeppers
Copy link
Member

@gmck it depends on how you installed, did you use command-line or the Visual Studio installer? If you used Visual Studio, then there is only a top-level MAUI Visual Studio workload to choose from.

@gmck
Copy link
Author

gmck commented Aug 7, 2024

Initially used VS installer. However, when it came to net8-android last year, I used your release notes which was the command-line. Very rarely do anything with the command-line. All upgrades to VS since on my machine have been VS.

@jonpryor jonpryor added the need-info Issues that need more information from the author. label Aug 26, 2024
@jonpryor
Copy link
Member

Please provide the requested .binlog.

@gmck
Copy link
Author

gmck commented Aug 27, 2024

@jonpryor
I provided a binlog in response to @dellis1972.
My apologies; I should have reported back. I solved the problem on my secondary machine, by uninstalling Visual Studio 2022 and VS Code. When reinstalled today with only Visual Studio 2022 17.12.0 Prev 1.0, I could recreate the project via Clone Repository and successfully build it. At this stage, I haven't got around to reinstalling VS Code on that machine.

@dotnet-policy-service dotnet-policy-service bot removed the need-info Issues that need more information from the author. label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review
Projects
None yet
Development

No branches or pull requests

4 participants