docker-android
docker-android copied to clipboard
8.1 emulator - Android restarts every few minutes
Operating System: CentOS 7
Docker Image: butomo1989/docker-android-x86-8.1
Docker Version:
18.06.1-ce
Docker-compose version (Only if you use it):
1.21.2, build a133471
Docker Command to start docker-android:
docker-compose
Expected Behavior
Android should not restart when performing actions (e.g. opening Chrome or Settings)
Actual Behavior
Android restarts in emulator at random moments. Sometimes it's enough to open settings and Android will restart. I can't get it to work for more than 5 minutes without a restart This doesn't happen on 7.1.1 image
Docker compose file
version: "3"
services:
selenium-hub:
image: selenium/hub:3.14.0-beryllium
container_name: selenium-hub
ports:
- "4444:4444"
android_web:
image: butomo1989/docker-android-x86-8.1
privileged: true
depends_on:
- selenium-hub
ports:
- "6080:6080"
environment:
- DEVICE=Samsung Galaxy S6
- CONNECT_TO_GRID=True
- APPIUM=True
- SELENIUM_HOST=selenium-hub
- MOBILE_WEB_TEST=True
- AUTO_RECORD=False
Happens for me too, checked logs and doesn't see anything suspicious Also, android 8.0 works fine
Yes happening for my tests as well. For test I ran ui/espresso/BasicSample in https://github.com/googlesamples/android-testing.git. Of the two tests first one passes but second one fails as emulator shows android is restarting. Running a single test passes but android restarts after the test.
Same thing happens for 9.0
I believe I'm having the same issue. When appium tries to look if the app I'm testing is installed, by executing: /root/platform-tools/adb -P 5037 -s emulator-5554 install /app/xxx.apk
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/root/platform-tools/adb -P 5037 -s emulator-5554 install /app/com.inditex.oysho.apk' exited with code 1'; Stderr: 'adb: failed to install /app/xxx.apk: cmd: Can't find service: package'; Code: '1' Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' System info: host: 'DESKTOP-BTHHNFN', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_172' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command '/root/platform-tools/adb -P 5037 -s emulator-5554 install /app/com.inditex.oysho.apk' exited with code 1'; Stderr: 'adb: failed to install /app/com.inditex.oysho.apk: cmd: Can't find service: package'; Code: '1'
I am monitoring the emulator and it looks like it resets at this point, causing the error above. Happens both in 8.1 and 9.0 but works fine in 7.1.1
A few days ago I was able to have samsung galaxy s6 running without restarting on 8.1. Yesterday it kept restarting, also for Nexus 5. On 8.0 Nexus 5 did not restart. This morning I removed my docker images and pulled them again. On 8.1 SGS6 restarted once but then I was able to use the chrome browser on it. I killed the pid of the qemu command and fixed the screen resolution settings of the SGS6 and started it again with command /bin/bash ./src/appium.sh, so I could see my website without errors.
The Nexus 5 seems even more unstable than SGS6 (on 8.1). On 8.1 I was able to use the chrome browser of the nexus 5 after killing the qemu command, start it again with /bin/bash ./src/appium.sh, it rebooted again a few times , I disabled Location it rebooted again and then I could use the chrome browser. No idea what's the pattern for having it work without restarting.
The problem must be on the emulator side, the same happens for me on another project for emulators > 8.1
Does somebody has a possibility to try running this on pure linux w/o docker? I believe it will happen also in this configuration, but who knows.. I even created an issue against emulator a long time ago, but no answer.. https://issuetracker.google.com/issues/113676492
I installed Android Studio on my Kubuntu 18.04 and ran the emulator: ~/Android/Sdk/emulator$ ./emulator -avd Nexus_5X_API_28_x86 -netdelay none -netspeed full it did not crash (so no constant restarting). (API 28 is Android 9.0 Pie) So I think the problem is with the docker images. I have no idea how they are created. @butomo1989 , can you ask whoever invented docker-android images to figure out why the emulated androids in the docker containers crash regularly since api 27 or 26 ? (a few times they did not crash for me) I had to uninstall the Android Studio as it took too much space on my / partition. Also this Studio was too heavy for my intel i3 from 2012 and the 4GB RAM. Running the emulator alone was much less heavy (you need kvm installed and vmx in /proc/cpuinfo of course).
@DieterRogiest interesting info.
The thing is that it is pure Linux: https://github.com/butomo1989/docker-android/blob/master/docker/Emulator_x86 maybe we just miss a library or smth..
Got this in adb logcat on every crash

I got the same issues with Ubuntu 18 & Samsung Galaxy S6
Same issue here on Ubuntu/Debian/OpenSuse with Android 8.1 and 9, it restart when the settings button is clicked.
Also, it always reboot 2/3 times after first boot when used in a docker swarm. No problem on a non-swarm architecture. Don't know if it's related to this issue.
The log from @rad96 contains some word about mem (Memory). I think you all should consider to review the remaining RAM of the host to make sure no OOM exception happen.
I suggest to monitor using command free -m and docker stats --all
8.1 is not supported anymore. Please check the documentation about the version that are supported now.