Skip to content

Commit

Permalink
chore: adjust java error
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban authored Nov 24, 2023
1 parent 978b7d3 commit 42eff59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions UnoCheck/Checkups/AndroidEmulatorCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public override Task<DiagnosticResult> Examine(SharedState history)
history.GetEnvironmentVariable("ANDROID_SDK_ROOT") ?? history.GetEnvironmentVariable("ANDROID_HOME"));
avds.AddRange(avdManager.ListAvds());
}
else
{
return Task.FromResult(
new DiagnosticResult(Status.Error, this, $"Unable to find Java {java}"));
}

// Fallback to manually reading the avd files
if (!avds.Any())
Expand Down Expand Up @@ -138,8 +143,6 @@ public override Task<DiagnosticResult> Examine(SharedState history)

var sdkId = sdkPackage?.Path ?? me.SdkId;

ReportStatus($"Emulator API Level: {me?.ApiLevel} avdManager:{avdManager}", Status.Ok);

avdManager.Create($"Android_Emulator_{me.ApiLevel}", sdkId, device: preferredDevice?.Id, tag: "google_apis", force: true, interactive: true);
return Task.CompletedTask;
}
Expand Down

0 comments on commit 42eff59

Please sign in to comment.