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

fix: Use arm64 android system on arm64 systems (backport #195) #198

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions UnoCheck/Checkups/AndroidSdkCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,24 @@ public override Task<DiagnosticResult> Examine(SharedState history)

if (installedPkg == null)
{
var packagePath = package.Path.Trim();
var packageVersion = package.Version;

if(packagePath.EndsWith("x86_64") && Util.IsArm64)
{
// On arm64 devices, use arm64 emulators
if(package.Alternatives.FirstOrDefault(a => a.Path.EndsWith("arm64-v8a")) is { } alternative)
{
packagePath = alternative.Path;
packageVersion = alternative.Version;
}
}

var pkgToInstall = sdkInstance?.Components?.AllNotInstalled()?
.FirstOrDefault(p => p.Path.Equals(package.Path.Trim(), StringComparison.OrdinalIgnoreCase)
.FirstOrDefault(p => p.Path.Equals(packagePath, StringComparison.OrdinalIgnoreCase)
&& p.Revision >= (v ?? p.Revision));

ReportStatus($"{package.Path} ({package.Version}) missing.", Status.Error);
ReportStatus($"{packagePath} ({packageVersion}) missing.", Status.Error);

if (pkgToInstall != null)
missingPackages.Add(pkgToInstall);
Expand Down
Loading