I am trying to add Android Q using AVD manager but it says: \"Package \"Android Emulator\" with revision at least 28.1.9 not available.\" Has anyone tried this before? what
For anyone who bumps into this issue whilst using Android's Command Line tools, --channel=3, at least on Windows, will not actually net you the latest version of the Android emulator, and thusly as it is dependent on that Emulator version, the latest Android images (particularly google_apis_playstore;x86 v8)
As a workaround, I was able to manually install the package by fishing around in the repositories here: https://dl.google.com/android/repository/repository2-1.xml
I was sufficiently annoyed about having a broken tool that I made a lightweight Python tool to do the steps below for most any package, which is what I link below under automated version.
This will also work for the Android Studio versions in theory, but I haven't tested those personally. Your mileage may vary.
AUTOMATED VERSION
Clone or otherwise download this repo: https://github.com/FailSpy/android-sdk-alternative
With Python 3.6+ installed, go into the folder you cloned it to with your commandline, and run python downloadtools.py emulator (or any package name if you're looking for other packages)
That will then download and unzip the latest package for you in the location of your SDK (using env. variables ANDROID_SDK_ROOT or ANDROID_SDK_HOME)
MANUAL VERSION
To make this easiest, you'll need an existing install of the emulator
To find the latest version download URL:
Find on that XML file a tag with path="emulator" featuring inside it the tag with 'channel-3' -- which signals latest version, locate the 'url' tag for the latest version for your platform (currently, emulator-windows-6549980.zip) and add that to the end of the previous URL -- replacing 'repository-2-1.xml'
e.g. https://dl.google.com/android/repository/emulator-windows-6549980.zip (if you're not too far from the future, you can just use this link rather than digging -- just replace 'windows' with 'darwin' for MacOS or 'linux' for Linux)
Take note also of the major, minor, and micro tags in the archive as well. We'll need this in a moment. In this case: 30, 0, and 16 respectively to make version 30.0.16
At that point, find your SDK install location
Find your currently installed emulator package in there under folder emulator, and edit your package.xml. Replace the major, minor, and micro with the version you found in the repo (or lazily with the version you know you need, though I don't recommend this)
Finally, delete the existing install (making sure to keep your edited package.xml!) and unzip your downloaded file into there, replacing your install.
Your SDK Manager should now recognize the emulator install as the version you set, and allow you to install the latest images.