maui
maui copied to clipboard
Update vs to Version 17.4.0 Preview 2.0 cause errors
Description
Got this exception: Severity Code Description Project File Line Suppression State Error XA5207 Could not find android.jar for API level 31. This means the Android SDK platform for API level 31 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-31\android.jar missing.) AutomationClient.MAUI C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Common.targets 533
Steps to Reproduce
- Create maui app in Version 17.4.0 Preview 1.0
- Upgrade maui app to Version 17.4.0 Preview 2.0
- You got this exception: Severity Code Description Project File Line Suppression State Error XA5207 Could not find android.jar for API level 31. This means the Android SDK platform for API level 31 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-31\android.jar missing.) AutomationClient.MAUI C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Common.targets 533
Link to public reproduction project repository
...
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
....
Did you find any workaround?
No
Relevant log output
this exception:
Severity Code Description Project File Line Suppression State
Error XA5207 Could not find android.jar for API level 31. This means the Android SDK platform for API level 31 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-31\android.jar missing.) AutomationClient.MAUI C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Common.targets 533
you just need to install sdk 31. then issue will disapper
Can you attaced screen cast how to install it through android manager.

In future when I will update Vs preview to new version I will need to update Vs only or to uninstall Vs and install it from scratch beacue of this missing file that I added manually.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
My .net MAUI program is getting the same error after upgrading VS preview from Version 17.4.0 Preview 1.0 to Version 17.4.0 Preview 2.1. It's working at .NET 6.0.486 and Version 17.4.0 Preview 1.0.
I manually installed the SDK 31. All the dependency error are gone. Now I am getting below error only in release mode. (An item with the same key has already been added).

I am searching the error message online. I found this post: https://stackoverflow.com/questions/73183482/an-item-with-the-same-key-has-already-been-added-maui-c-sharp What is the correct way to fix this? Is this a bug from VS preview?
Currently having the same issue, I'm running the latest version of visual studio 2022 preview and can't even load up the default .NETmaui sample app.
When compiling on the windows machine

when going to (Tools > Android > Android SDK Manager) and updating I recieve this error


I don't understand this. I'm lost. It is already installed

Thanks for the issue report @danies8! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.
If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
- Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
- Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
This issue will be automatically closed in 3 days if there are no further comments.
This issue is being closed due to inactivity. If this issue is still affecting you, please follow the steps above to use the VS Feedback Tool to report the issue.