Not able to Create AVD using command line - android

I have downloaded the basic Android command line tools from devloper.android.com, now i am creating a new AVD using following command
avdmanager create avd --package 'platforms;android-26;google_apis;x86' -n test-1
Its giving error
Error: Package path is not valid. Valid system image paths are:
I have already installed the package using sdkmanager and its available in my sdk folder under platforms.

First, you need to download the necessary packages.
Here is an example of downloading API 23 packages for x86 emulators:
./sdkmanager "system-images;android-23;google_apis;x86"
and then create your emulator:
./avdmanager create avd -n test -k "system-images;android-23;google_apis;x86" -b x86 -c 100M -d 7 -f
Or you can try with this sample steps:
android update sdk -u --filter platform-tools,android-25
sdkmanager --verbose "system-images;android-25;google_apis;x86"
and then create the avd using:
avdmanager -v create avd -n x86 -k "system-images;android-25;google_apis;x86" -g "google_apis"

Related

error: package path is not valid. valid system image paths are:ository... null

I have installed the command line tools of android, correctly configured all environment variables.
When I am creating a virtual device with this command:
avdmanager create avd -n test -k "system-images;android-23;google_apis;x86"
It gives the following error:
error: package path is not valid. valid system image paths are:ository... null
I have already installed the SDK tool : sdkmanager "system-images;android-23;google_apis;x86"
And accepted the licenses sdkmanager --licenses
But still it's showing the same error.
By the way, I am using it for react-native
In order to resolve your issue, you need to first run the cmd sdkmanager --list. A list will be populated with installed & available modules make sure: you have installed
Build-tools sdkmanager build-tools 30
Platform-tools sdkmanager platform 30
System image sdkmanager "system-images;android-30;google_apis;x86"
System image sdkmanager "system-images;android-30;google_apis;x86_64"
After installing or making sure the above are installed you can go ahead on creating avd.
Create an avd - avdmanager create avd -n TestAVD -k "system-images;android-30;google_apis;x86" --device "Pixel_4"
List created avds emulator -list-avds
Start Emulator or AVD emulator #TestAVD
I've resolved the issue by installing image first
like
sdkmanager --install "system-images;android-23;google_apis;x86"
and then it is possible to create the emulator
It seem that avdmanager can not find the local image. Please try:
cd YOUR_SDK_ROOT_DIRECTORY
avdmanager create avd -n test -k "system-images;android-23;google_apis;x86"

ANDROID AVD "emulator" package must be installed

I want install new device in my docker container.
I had dowload new sdk
./sdkmanager "system-images;android-23;google_apis;x86"
I had accept all licences
./sdkmanager --licenses
And now I want create a new emulator with AVDMANAGER
./avdmanager create avd -n test -k "system-images;android-23;google_apis;x86" --abi google_apis/x86 --force
When I launch command, I have this message
Do you wish to create a custom hardware profile? [no]
I press yes and I have this error
Error: "emulator" package must be installed!
Can you explain me how I can install this package ?
The solution is:
./sdkmanager --channel=3 emulator

How to create an AVD for "system-images;android-27;google_apis;x86" using avdmanager command line in Ubuntu?

I am able to create emulators for android-26 and older using the avdmanager command line, but I am getting the following error when trying to create for android-27 and above:
~/Android/sdk/tools/bin/avdmanager create avd --force -n Tablet -k "system-images;android-27;google_apis;x86" -d 6 --sdcard 200M
Error: Package path is not valid. Valid system image paths are:ository...
system-images;android-26;google_apis;x86
null
The same command for android-26 works:
~/Android/sdk/tools/bin/avdmanager create avd --force -n Tablet -k "system-images;android-26;google_apis;x86" -d 6 --sdcard 200M
Am I missing anything?
P.S.: This is happening in Linux Ubuntu. It seems to work fine in Mac OS.
Your command is correct but problem is that in your system, you don't have "android-27" OS
Please check which OS you have in your system, go into following directory
directory path : ~\Android\Sdk\platforms
if you don't have it please download it first.
download command is : sdkmanager --install "system-images;android-27;google_apis;x86"

AVDMANAGER -> Error: Invalid --tag default for the selected package

$ avdmanager create avd -n test -k "system-images;android-24;google_apis;x86"
Error: Invalid --tag default for the selected package.
How to solve this error?
Use the --abi google_apis/x86 flag.
The data store that the sdkmanager v26.1.1 uses is out of date.
Update your tools with:
sdkmanager --update
It will then have the updated tags to choose from. One can also run:
avdmanager -v create avd -g google_apis -n Android-27 -k "system-images;android-27;google_apis;x86"
But always better to run with updated tools.

How to set system images (path?) when creating an Android AVD?

I'm trying to create an AVD with Android on Linux. When I run android create avd in my Cordova project folder, I get this message:
-k --package : Package path of the system image for this AVD (e.g.
'system-images;android-19;google_apis;x86'). [required]
My problem is that I have no idea what to add for this option and can't find any good references online. Apparently I have system images installed:
But how do I reference these? I took a stab at it based on the example and I get this error:
david#david-Virtual-Machine:~/projects/test-test$ android create avd --package "system-images;android-25;google-apis;x86" --name "foo"
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running //home/david/Android/Sdk/tools/bin/avdmanager create avd --package system-images;android-25;google-apis;x86 --name foo
Error: Package path is not valid. Valid system image paths are:
(In my platforms folder the only platform listed is android-25)
Any suggestions?
Pay attention that android is deprecated. Use avdmanager.
First, you need to download the necessary packages.
Example of downloading API 23 packages for x86 emulators:
./sdkmanager "system-images;android-23;google_apis;x86"
Then accept the license agreement
./sdkmanager --licenses
and then create your emulator
./avdmanager create avd -n test -k "system-images;android-23;google_apis;x86" -b x86 -c 100M -d 7 -f
The message
Error: Package path is not valid. Valid system image paths are:
indicates that the package could not be found - I bet the platform wasn't correctly installed .. In order to fix that problem, You can try installing it using the following commands:
android update sdk -u --filter platform-tools,android-25
sdkmanager --verbose "system-images;android-25;google_apis;x86"
and then create the avd using: avdmanager -v create avd -n x86 -k "system-images;android-25;google_apis;x86" -g "google_apis".
I hope this helps.
You can also list your installed and available packages using:
$ sdkmanager --list
To install a system image use this:
$ sdkmanager "system-images;android-25;google_apis;x86_64"
Then as stated above create the avd:
$ ./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86_64" -b x86 -c 100M -d 7 -f
You have to put package path with semicolons.
an example of a valid path would be
avdmanager create avd -k "system-images;android-16;google_apis;x86"
and put all other options that you require.
As the advice properly says, the android command is deprecated. You need to use avdmanager and also specify the exact string that appears on your available packages as the package argument. In your case:
avdmanager create avd --package "android-25" --name "foo"
Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.
Prerequisites:
See for brew, python3 and NodeJS on nvm see gist https://gist.github.com/agrcrobles/3d945b165871c355b6f169c317958e3e
Java 14
Open JDK 14 works fine with gradle 6.x
Preferred: To install the JDKs 8 ( LTS )
AdoptOpenJDK:
# brew tap adoptopenjdk/openjdk via cask
brew install adoptopenjdk/openjdk/adoptopenjdk8
SDK preferred location
sdk can be installed on /Library/Android/sdk or /usr/local/ to be sure check it by
which sdkmanager
Export ANDROID_HOME
export ANDROID_HOME=$HOME/Library/Android/sdk
or
export ANDROID_HOME="/usr/local/share/android-sdk"
Install all of the Android SDK components (you will be prompted to agree to license info and then this will take a while to run):
If you need to have openjdk first in your PATH run:
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc
## android-29
touch ~/.android/repositories.cfg
yes | sdkmanager --licenses
sdkmanager --update
sdkmanager --no_https --install emulator
sdkmanager --no_https --install platform-tools
sdkmanager --no_https --install 'system-images;android-29;google_apis_playstore;x86_64'
sdkmanager --no_https --install 'extras;intel;Hardware_Accelerated_Execution_Manager'
sdkmanager --no_https --install 'build-tools;29.0.2'
sdkmanager --no_https --install 'platforms;android-29'
sdkmanager --list
avdmanager list (find device skin id, lets use pixel 17)
avdmanager create avd -f -n test -d 17 -k 'system-images;android-29;google_apis_playstore;x86_64'
avdmanager list avd (or emulator -list-avds)
Happy code!!

Categories

Resources