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

[Xamarin.Android.Build.Tasks] Fix message for missing Platform error XA5207 #1152

Merged
merged 3 commits into from
Jan 4, 2018

Conversation

dellis1972
Copy link
Contributor

Fixes #1136

Commit 7f45a6d reworked the GetJavaPlatformJar Task (and others)
to handle a NRE exception. However the error logging code in
MonoAndroidHelper.cs was not formatted correctly. As a result
the XA5207 error would be logged without any message.

This commit fixes up the LogError call to make sure the error
has a decent message. It also adds a unit test so that we can
catch this issue if it regresses in the future.

…XA5207

Fixes dotnet#1136

Commit 7f45a6d reworked the GetJavaPlatformJar Task (and others)
to handle a NRE exception. However the error logging code in
MonoAndroidHelper.cs was not formatted correctly. As a result
the XA5207 error would be logged without any message.

This commit fixes up the LogError call to make sure the error
has a decent message. It also adds a unit test so that we can
catch this issue if it regresses in the future.
@dellis1972 dellis1972 added the Area: xamarin-android Build Issues building the xamarin-android repo *itself*. label Jan 3, 2018
@@ -543,7 +543,7 @@ public static string TryGetAndroidJarPath (TaskLoggingHelper log, string platfor
var platformPath = MonoAndroidHelper.AndroidSdk.TryGetPlatformDirectoryFromApiLevel (platform, MonoAndroidHelper.SupportedVersions);
if (platformPath == null) {
var expectedPath = MonoAndroidHelper.AndroidSdk.GetPlatformDirectoryFromId (platform);
log.LogError ("XA5207", "Could not find android.jar for API Level {0}. " +
log.LogError (null, "XA5207", null, null, 0, 0, 0, 0, "Could not find android.jar for API Level {0}. " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the 9 parameter LogError() method, perhaps we should instead use our log.LogCodedError() extension method?

@jonpryor jonpryor merged commit 0140ac6 into dotnet:master Jan 4, 2018
jonpryor pushed a commit that referenced this pull request Jan 4, 2018
…XA5207 (#1152)

Fixes: #1136

Commit 7f45a6d reworked the `<GetJavaPlatformJar/>` Task (and others)
to handle a `NullReferenceException`. However the error logging code
in `MonoAndroidHelper.cs` was not formatted correctly. As a result
the XA5207 error would be logged without any message.

This commit fixes up the `LogError()` call to make sure the error
has a decent message. It also adds a unit test so that we can
catch this issue if it regresses in the future.
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jan 22, 2021
Fixes: xamarin/monodroid#1147
Fixes: xamarin/monodroid#1150
Fixes: xamarin/monodroid#1123

Changes: xamarin/monodroid@3586135...06e80c5

  * xamarin/monodroid@06e80c567: [tools/msbuild] FastDeploy is not ignoring warnings in output  (dotnet#1151) (dotnet#1152)
  * xamarin/monodroid@1f08686de: [tools/msbuild] <FastDeploy/> Length cannot be less than zero (dotnet#1148)
jonpryor added a commit that referenced this pull request Jan 22, 2021
Fixes: xamarin/monodroid#1123
Fixes: xamarin/monodroid#1147
Fixes: xamarin/monodroid#1150

Changes: xamarin/monodroid@3586135...06e80c5

  * xamarin/monodroid@06e80c567: [tools/msbuild] FastDeploy is not ignoring warnings in output  (#1151) (#1152)
  * xamarin/monodroid@1f08686de: [tools/msbuild] <FastDeploy/> Length cannot be less than zero (#1148)
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: xamarin-android Build Issues building the xamarin-android repo *itself*.
Projects
None yet
2 participants