Issue
After running sdkmanager --update
, I can no longer successfully launch AVDs created using avdmanager
with the following images:
system-images;android-27;google_apis;x86
system-images;android-26;google_apis;x86
I can, however, use the system-images;android-25;google_apis;x86
image. Alternatively, if created using Android Studio, an emulator created with the aforementioned images will work - every time.
When creating using avdmanager
, I am running: avdmanager create avd -n TEST_1234 -k 'system-images;android-27;google_apis;x86' -d 'Nexus One' -f
I have tried to run it without specifying a device, and also with the -c
option to specify an initial sdcard size, but no combination is working past the issue.
When trying to launch one of these AVDs with the emulator, it seems to get stuck in a loop, repeatedly outputting the below:
emulator: onGuestSendCommand: [0x7f0b315d2730] Adb connected, start proxing data
emulator: onGuestClose: [0x7f0b315d2730] Adb closed by guest
emulator: onGuestClose: [0x7f0b317a33e0] Adb closed by guest
emulator: onGuestSendCommand: [0x7f0b29741ac0] Adb connected, start proxing data
emulator: onGuestClose: [0x7f0b29741ac0] Adb closed by guest
emulator: onGuestClose: [0x7f0b2b8a3780] Adb closed by guest
emulator: onGuestSendCommand: [0x7f0b301518a0] Adb connected, start proxing data
emulator: onGuestClose: [0x7f0b301518a0] Adb closed by guest
emulator: onGuestClose: [0x7f0b3121f540] Adb closed by guest
emulator: onGuestSendCommand: [0x7f0b30d3a700] Adb connected, start proxing data
emulator: onGuestClose: [0x7f0b30d3a700] Adb closed by guest
emulator: onGuestClose: [0x7f0b3052cbc0] Adb closed by guest
Likewise, if I launch the AVD manager in Android Studio after creating an AVD using the terminal avdmanager
, it will not allow me to launch them (no error messages, just does not respond when pressing the play button).
Should I choose to open the "Edit Device" window, within Android Studio, making no changes to it and clicking the save button will then allow me to launch it.
Doing this makes changes to the AVD's configuration file, which I believe is responsible for the launch working.
When creating using avdmanager
, the config.ini
file looks like this:
PlayStore.enabled=false
abi.type=x86
avd.ini.encoding=UTF-8
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.cpu.arch=x86
hw.dPad=no
hw.device.hash2=MD5:0250c2773d1dd25bb2b12d9502c789f7
hw.device.manufacturer=Google
hw.device.name=Nexus One
hw.gps=yes
hw.lcd.density=240
hw.lcd.height=800
hw.lcd.width=480
hw.mainKeys=yes
hw.sdCard=yes
hw.sensors.orientation=no
hw.sensors.proximity=yes
hw.trackBall=yes
image.sysdir.1=system-images/android-27/google_apis/x86/
tag.display=Google APIs
tag.id=google_apis
After editing in Android Studio, or when creating via Android Studio, it will look like this:
AvdId=TEST_1234
PlayStore.enabled=false
abi.type=x86
avd.ini.displayname=TEST 1234
avd.ini.encoding=UTF-8
disk.dataPartition.size=800M
fastboot.forceColdBoot=no
hw.accelerometer=yes
hw.arc=false
hw.audioInput=yes
hw.battery=yes
hw.camera.back=none
hw.camera.front=none
hw.cpu.arch=x86
hw.dPad=no
hw.device.hash2=MD5:0250c2773d1dd25bb2b12d9502c789f7
hw.device.manufacturer=Google
hw.device.name=Nexus One
hw.gps=yes
hw.gpu.enabled=yes
hw.gpu.mode=guest
hw.initialOrientation=Portrait
hw.keyboard=no
hw.lcd.density=240
hw.lcd.height=800
hw.lcd.width=480
hw.mainKeys=yes
hw.ramSize=512
hw.sdCard=yes
hw.sensors.orientation=no
hw.sensors.proximity=yes
hw.trackBall=yes
image.sysdir.1=system-images/android-27/google_apis/x86/
runtime.network.latency=none
runtime.network.speed=full
sdcard.size=100M
showDeviceFrame=no
skin.dynamic=yes
skin.name=480x800
skin.path=_no_skin
skin.path.backup=_no_skin
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=16
After working my way through the differences in these settings, I found that if I create a new AVD using avdmanager
, but then add the following line to the newly created config file, it will successfully launch:
disk.dataPartition.size=800M
So, it seems as if this is the core setting that Android Studio is adding which makes the AVDs usable from Android Studio, but not avdmanager
.
Does anyone know how one can force avdmanager
to set this? I see no option for it, but without setting this, it's not possible to create AVDs using avdmanager
on its own.
Solution
Problem solved - having discovered the troublesome setting, I've managed to find an argument that can be used when launching emulator
, which allows this to be specified: -partition-size
Launching an emulator using emulator -avd TEST_1234 -partition-size 800 -verbose
will work around the problem and will successfully launch emulators created using the newer images.
Answered By - user1243584
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.