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

Update Error messaging and Documentation to include IDE/CLI instructions #8494

Merged
merged 14 commits into from
Dec 6, 2023

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Nov 9, 2023

Context #8413
Context #8522

There was a single point in our error messaging which has IDE specific instructions. We need to update this since VSForMac has been deprecated and VSCode is now supported. Our error messaging should take into account which
IDE is being used. For standard VS we keep the existing instructions. For anything else we should provide the required
Command Line instructions. This will include VSCode since the UI elements present in VS are not present in VSCode.

Also update some of the documentation around AndroidInstallDependencies to mention parameters which are required in order for the target to function correctly.

@dellis1972 dellis1972 force-pushed the Issue8413 branch 2 times, most recently from 21ba8af to 86625b1 Compare November 16, 2023 14:48
@dellis1972 dellis1972 force-pushed the Issue8413 branch 2 times, most recently from 9951fd7 to 8799491 Compare November 27, 2023 09:46
@dellis1972 dellis1972 changed the title Issue8413 Update Error messaging and Documentation to include IDE/CLI instructions Nov 27, 2023
@dellis1972 dellis1972 marked this pull request as ready for review November 27, 2023 10:08
@dellis1972 dellis1972 force-pushed the Issue8413 branch 2 times, most recently from 4bb3ec4 to 8a774ca Compare November 29, 2023 10:00
@jonpryor
Copy link
Member

jonpryor commented Dec 6, 2023

Draft commit message:

Context: https://github.com/xamarin/xamarin-android/issues/8413
Context: https://github.com/xamarin/xamarin-android/issues/8522

The [XA5207][0] error message contained IDE-specific instructions:

	# Visual Studio
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
	  Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change your Xamarin.Android project
	  to target an API version that is installed.

	# Visual Studio for Mac
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
	  Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change your Xamarin.Android project
	  to target an API version that is installed.

[Visual Studio for Mac is now deprecated][1]:

> Visual Studio for Mac is scheduled for retirement by August 31, 2024

Visual Studio Code is now supported, via [C# Dev Kit][2] and the
[.NET MAUI][3] extensions.  ([Announcement][4].)

These changes mean that our error messages are obsolete (building on
macOS) or misleading (building within VSCode on Windows).

Update the XA5207 error generation logic to take these changes into
consideration.  Visual Studio (Windows) will retain the existing
error message text.  The Visual Studio for Mac instructions are
replaced with instructions for command-line builds, for use from
Visual Studio Code:

	# Visual Studio
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
	  it was expected to be in `…`.
	  Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET Android project
	  to target an API version that is installed.
	  See https://aka.ms/xa5207 for more details.

	# Visual Studio Code
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
	  it was expected to be in `…`.
	  You can install the missing API level by running
	  `dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=…"`,
	  or change the project to target an API version that is installed.
	  See https://aka.ms/xa5207 for more details.


Also update some of the documentation around the
`InstallAndroidDependencies` target to mention `dotnet build` options
which are required in order for the target to function correctly.

[0]: https://github.com/xamarin/xamarin-android/blob/40cc8eaf78eb9f95abcc0e966ab274cef1692acc/Documentation/guides/messages/xa5207.md
[1]: https://learn.microsoft.com/en-us/visualstudio/mac/what-happened-to-vs-for-mac?view=vsmac-2022
[2]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit
[3]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-maui
[4]: https://devblogs.microsoft.com/visualstudio/announcing-the-dotnet-maui-extension-for-visual-studio-code/

@jonpryor jonpryor merged commit 6fa67be into dotnet:main Dec 6, 2023
45 of 47 checks passed
jonathanpeppers pushed a commit that referenced this pull request Dec 6, 2023
Context: #8413
Context: #8522

The [XA5207][0] error message contained IDE-specific instructions:

	# Visual Studio
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
	  Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change your Xamarin.Android project
	  to target an API version that is installed.

	# Visual Studio for Mac
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed.
	  Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change your Xamarin.Android project
	  to target an API version that is installed.

[Visual Studio for Mac is now deprecated][1]:

> Visual Studio for Mac is scheduled for retirement by August 31, 2024

Visual Studio Code is now supported, via [C# Dev Kit][2] and the
[.NET MAUI][3] extensions.  ([Announcement][4].)

These changes mean that our error messages are obsolete (building on
macOS) or misleading (building within VSCode on Windows).

Update the XA5207 error generation logic to take these changes into
consideration.  Visual Studio (Windows) will retain the existing
error message text.  The Visual Studio for Mac instructions are
replaced with instructions for command-line builds, for use from
Visual Studio Code:

	# Visual Studio
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
	  it was expected to be in `…`.
	  Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET Android project
	  to target an API version that is installed.
	  See https://aka.ms/xa5207 for more details.

	# Visual Studio Code
	error XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed;
	  it was expected to be in `…`.
	  You can install the missing API level by running
	  `dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=…"`,
	  or change the project to target an API version that is installed.
	  See https://aka.ms/xa5207 for more details.


Update some of the documentation around the
`InstallAndroidDependencies` target to mention `dotnet build` options
which are required in order for the target to function correctly.

Finally, update various error messages, replacing "Xamarin.Android"
with ".NET Android".

[0]: https://github.com/xamarin/xamarin-android/blob/40cc8eaf78eb9f95abcc0e966ab274cef1692acc/Documentation/guides/messages/xa5207.md
[1]: https://learn.microsoft.com/en-us/visualstudio/mac/what-happened-to-vs-for-mac?view=vsmac-2022
[2]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit
[3]: https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-maui
[4]: https://devblogs.microsoft.com/visualstudio/announcing-the-dotnet-maui-extension-for-visual-studio-code/
grendello added a commit that referenced this pull request Dec 6, 2023
* main:
  [tests] trim trailing `\` from AndroidSdkDirectory/JavaSdkDirectory (#8564)
  [Xamarin.Android.Build.Tasks] Update XA5207 for VSCode (#8494)
@dellis1972 dellis1972 deleted the Issue8413 branch December 7, 2023 10:43
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants