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

[BUG] uno-check creates a x86_64 android emulator for M1 #97

Closed
pictos opened this issue Sep 28, 2022 · 4 comments · Fixed by #98
Closed

[BUG] uno-check creates a x86_64 android emulator for M1 #97

pictos opened this issue Sep 28, 2022 · 4 comments · Fixed by #98

Comments

@pictos
Copy link
Contributor

pictos commented Sep 28, 2022

When I run the uno-check tooling in an M1 device, and I don't have an Android Emulator, it creates a x86_64 device which is incompatible with M1.

  1. Delete all androids emulator that you may have
  2. Run the uno-check and type y when asked to install the Android Emulator
  3. See the emulator installed

Before run the uno-check:
Screen Shot 2022-09-28 at 13 57 19

When uno-check is done:
Screen Shot 2022-09-28 at 13 57 50

I would like that uno-check knows that I'm running on a arm device and install the correct emulator for me. (hope that's possible)

@jeromelaban
Copy link
Member

Thanks for the report!

Indeed that's possible. This would have to be changed here:

var installer = new AndroidSDKInstaller(new Helper(), AndroidManifestType.GoogleV2);
installer.Discover();
var sdkInstance = installer.FindInstance(null);
var installedPackages = sdkInstance.Components.AllInstalled(true);
var sdkPackage = installedPackages.FirstOrDefault(p => p.Path.Equals(me.SdkId, StringComparison.OrdinalIgnoreCase));
if (sdkPackage == null && (me.AlternateSdkIds?.Any() ?? false))
sdkPackage = installedPackages.FirstOrDefault(p => me.AlternateSdkIds.Any(a => a.Equals(p.Path, StringComparison.OrdinalIgnoreCase)));
var sdkId = sdkPackage?.Path ?? me.SdkId;
avdManager.Create($"Android_Emulator_{me.ApiLevel}", sdkId, device: preferredDevice?.Id, tag: "google_apis", force: true, interactive: true);
return Task.CompletedTask;
}

We already have the information about the host architecture.

@pictos
Copy link
Contributor Author

pictos commented Sep 29, 2022

@jeromelaban should we add the arm emulator here in the manifest?
I saw that the tooling uses the manifest information to suggest an emulator

Just saw the alternativies property, that points to arm, let me try with that

@jeromelaban
Copy link
Member

We may want to install just the one appropriate for the architecture, if possible, otherwise, let's modify the tool for that to be possible.

@pictos
Copy link
Contributor Author

pictos commented Sep 29, 2022

Hey Jerome,

So, looks like something is not correct, I'm debugging on my MacBook, that has these specs:
Screen Shot 2022-09-29 at 18 22 20

And during the debug the Util.IsArm64 is false, saying that I'm in a x64 machine.
Screen Shot 2022-09-29 at 18 22 05

I believe that issue is with .net, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants