Fix error: There was no runtime pack for Microsoft.Android available for the specified RuntimeIdentifier 'win-x64'

StevenSquires-9060 21 Reputation points
2024-03-13T00:25:03.1066667+00:00

Several weeks ago I had a working app that had 4 tabs and in the 1st tab I wanted to place a Google Map. I upgraded my Visual Studio from .Net 7.0 to .Net 8.0 and have not been able to successfully compile for a month. All of a sudden .net maui has decided to compile platforms I previously was not using and my code was still attempting to compile them. Somehow between the addition of .net 8.0 and map configuration in my 1st tab I find myself fighting other issues that did not exist. With that I simplified and created a rudimentary test program (just iOS and Android) that simply creates a project and puts a Google Map on the MainPage. As I mentioned initially, it tried to also compile maccatalyst and windows. I identified that TargetFrameworks should only be Android and iOS using "<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>". I also fought the new SelfContained app issue using the solution I found and adding it to my csproj file (<SelfContained>true</SelfContained>). Even after fixing these when I only had 1 Error and 1 Warning - it produced 5 new errors. How do I turn off compiling of Plaforms I am not targeting?

If anyone can help, I would greatly appreciate it - as I am just trying to keep development progressing on my original project. The picture below is from a test project that is showing the same issue except it is .net 7.

compile errors.txt

namespace errors.txt

Errors - MapMauiApp1

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,968 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,130 questions
{count} votes