Question
Can you only create the Pixel 2 virtual device via Android Studio (v3.1.4) and not via avdmanager?
What we want to do
Use avdmanager to create a Pixel 2 device automatically (Continuous Integration script based on avdmanger). We need to use the pixel 2 device explicitly.
Problem
Executing $ANDROID_HOME/tools/bin/avdmanager list
does not return a Pixel 2 hardware profile but returns an error:
Parsing ****
Available Android Virtual Devices:
The following Android Virtual Devices could not be loaded:
Name: Pixel_2_API_28
Path: /home/user/.android/avd/Pixel_2_API_28.avd
Error: Google pixel_2 no longer exists as a device
Available devices definitions:
id: 0 or "tv_1080p"
Name: Android TV (1080p)
OEM : Google
Tag : android-tv
Additional Details
I had to execute the following command to execute the avdmanager command with JAVA 10.0.2 export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
. Else, I receive the error mentioned here: Failed to install android-sdk: "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema"
I was able to find the description of the Pixel 2 that the Android Studio plugin uses in
com/android/sdklib/devices/nexus.xml
,
that file is in
$ANDROID_HOME/plugins/android/lib/sdklib.jar
but I haven't been able to figure out how to get avdmanager
to load the same sdklib that the Android Studio plugin uses.
I've solved the problem using AndroidSDK/cmdline-tools/latest/bin/avdmanager
.
The old AndroidSDK/tools
folder has been deprecated and should not be used anymore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With