I am currently trying to install the Android Emulator via the Android SDK and Tools dialog. But I am receiving the Error Message:
Operation Failed: Installing Android Emulatorv31.2.10 "Specified argument was out of the range of valid values".
I removed all set up devices so far still no success. As for SDK Build Tools I have 33, 32 and 31 installed and Platforms as well 33, 32, 31
Log:
[2022-11-09 13:53:41.5] WARNING: [Resiliency.Polly.Policies]: Delegate has thrown System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Xamarin.Installer.AndroidSDK.Manager.Helper.<CheckIfNetworkAvailable>d__38.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Polly.Retry.AsyncRetryEngine.<ImplementationAsync>d__0`1.MoveNext(), retrying...
[2022-11-09 13:53:42.6] ACTION: Install start component emulator
[2022-11-09 13:53:42.6] EXCEPTION: Downloading Android Emulator v31.2.10 failed, Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at Xamarin.Installer.AndroidSDK.MonitorWithTotalProgress.set_SubComponentsCount(Int32 value)
at Xamarin.Installer.AndroidSDK.Manager.AndroidSDKComponent.<Install>d__66.MoveNext()
[2022-11-09 13:53:42.6] ACTION: Install result InstallationError component emulator
[2022-11-09 13:53:42.6] ACTION: ApplySdkComponentChanged uninstall:[] install:[emulator]
CodePudding user response:
I am facing the same issue and I think I got the solution.
Do the following. There are multiple steps here. Did a lot of trial and error. First install Google Play Intel x86 Atom_64 System Image.
Then once you install it, the emulator should be installed automatically.
It took me quite a long time, with multiple steps being involved.
Had to restart the laptop several times.
Take a look at the following screenshots.
CodePudding user response:
Interesting enough I wasn't able to install the emulator for some reason. The answer from VikekDev did not work as well.
What I did was I removed all sdk installed them again tried install the emulator -> failed.
Then I tried to create a device in the device manager (API31) which interesting enough worked. Then I booted the device and suddenly the emulator came up and booted the created device. VS then complained that my target version is < 31 which fair enough is true and for testing I set it to 31 and now my App compiled and was able to deploy in the emulator as well.
If I now check the SDKs and Tools a Emulator is present again.
So maybe it pulled the correct emulator when I added the device? I am not sure what fixed it but maybe some of my steps or VivekDev post will help someone else tackle the problem.