Espresso tests not working with new Google Android Emulators - android

About a month ago I upgraded to Android Studio 2.0 after being on 1.5 for quite a while. I have a suite of 23 tests built on top of Espresso that drive my app.
Normally, I use Genymotion Pro but I have been trying to get a CI server going and I wanted to use the "new and improved" Google Android Emulators.
Today I finally got around to trying the new emulators. I was pleasantly surprised after installing my app and playing with it.
My optimism quickly faded when I went to run my tests via Android Studio. Here are some of the problems I encountered:
The test took a ridiculous amount of time to install and sometimes hung for over 5 minutes at which point I would close them.
The emulator restarts itself between every test. This adds a considerable amount of time to total execution. Sometimes when restarting it just freezes up and I have to close it.
Tests failing randomly for no reason.
After a test finishes running sometimes the emulator just hangs on a black screen for a long time. Sometimes for so long I just kill the emulator.
After the tests do finish the emulator is often unresponsive and broken.
Note that none of the above ever happens with Genymotion.
Some additional info:
My machine is a MacBook Air running Yosemite (10.10.5)
My app uses the newest versions of all SDK dependencies right now.
Animations are turned off on the Emulators
I am compiling with Java 1.8 and using RetroLambda (I don't see why this would matter but who knows)
I am pretty confident that my Espresso tests ran smoothly on the pre-2.0 Emulators, but it has been at least a month since I would have done that and I can't say for sure. I will probably downgrade and try it out if nothing else works.
Log cat hasn't provided me with any useful info when all of this is happening.
Tests work fine on real devices connected via USB.
Things I have tried:
I thought it was possible that this was an issue with Android Studio. Alas, with Gradle on the command line the same issues occur.
I have tried a bunch of different variations of device type and ABI version, the problem occurs on all of them.
I downloaded a few Espresso sample projects from Github. I experienced the same issue with all these projects, indicating that this probably isn't an issue with my particular Espresso setup.
Deleting old emulators and making new ones.
Coworkers have replicated the issue across machines (all macs of various kinds)
I am perplexed by this. Is anyone else experiencing the same thing? Is there anyway I can get the Google Android Emulators to run tests in a useful way?
Thanks!

Related

Launching instrumented tests on REAL DEVICE produces timed out waiting for process to appear - MacBook Air M1

I'm stuck on a time out error, and after reading about all the subjects on Stack Overflow I can't find a solution for my problem.
I'm trying to launch an instrumented test from Android Studio (last version) on a real device (I tried different devices, it doesn't seem to be related to the device)
The test I'm trying to launch has been automatically generated by Espresso Test Recorder.
Only the tests produce time out, I can launch the app normally.
I'm working on a MacBook Air M1, on last version of Android Studio if it makes a difference. But since I'm trying to run the test on a real device, it shouldn't be a problem... right? Are there here some people who encountered this kind of problem?
Already tried to plug/unplug the phone, invalidate cache/ restart ; can't try to launch on an emulator since I'm on a M1 Mac...

Android Things - Slow Installation on NXP PICO-PI-iMX6UL

We are experiencing extremely long installation/start/run times for Android Things applications on the NXP PICO-PI-IMX6UL. This issue is observable when using both Android Studio and adb directly on the command line.
A small application of ~2MB in size takes anywhere from 5 to 15 minutes to install. The same application on the Intel Edison only takes only a few seconds to install.
It's worth noting that other adb operations seem to run very slowly as well (i.e. shell, logcat, etc.).
We have closely followed the procedures outlined using these resources to install the Android Things image:
https://developer.android.com/things/hardware/imx6ul.html
We have re-flashed the Android Things image several times and experience the same issues.
To rule out any application issues, we have tried installing/running the Android Things sample template application found here: https://github.com/androidthings/new-project-template and experience the same issues. We can verify that this application installs/runs without issue on an Intel Edison board running Android Things 4.1.
Here are a few more details about our setup:
Host:
Mac OS 10.12.6
Android Studio version 2.3.3
Android Debug Bridge version 1.0.39
i.MX6UL:
Android Things Developer Preview Image 5.1
Any suggestions on what is wrong with our setup or what might be causing these issues?
Thanks!
Update 10/20/2017
Further testing with additional NXP i.MX6UL boards has only shown minor improvements in installation and runtimes, and the results are not consistent. We also tried swapping out the daughterboard for an older version (Wandboard i.MX6UL), but the results were the same.
We plan to continue testing as newer versions of Android Things are released, but in the meantime we are going to continue development with the Intel Edison, despite it being discontinued.
I assume there is something wrong with the chip configuration, since simply keeping the kernel "alive" keeps the system rather busy with only 50% idle.. Running the gradle task "uninstallAll" solved the problem if I was not able to start further debug sessions.
Show current CPU usage:
adb shell
top

Android Studio Emulator is not starting up for the first time?

I just started learning android studio but for some reason, my emulator is not starting up. I read similar questions asked here and tried many different things and I manage to get the emulator loading console to appear for a few seconds before disappearing forever. Even though gradle build has become quite fast, the emulator still refuses to show.
I tried changing RAM, making new devices, updating path on 'program structures' installing HAXM and any other thing that seemed to work or other people but I still get this error when I run it
" Error while waiting for device: Timed out after 300seconds waiting for emulator to come online. "
I was really looking forward to learning app development for my project but this issue is hindering my progress significantly.
Any help is appreciated.
EDIT: My android studio is version 2.3.1 and I am following TheNewBoston video series.
Android Studio Emulator is little slow sometimes or if you are not running a PC with good configurations , mostly it won't work , instead of running your app in Android Studio Emulator , you can try these emulators
or you can run it on your own device , for that please follow the link for official documentation

Android Studio makes Windows 10 crash

I've been using Android Studio for a few months without any hiccups but now it keeps using too much computer resources resulting to system crash and sometimes blue screen of death. The usage of CPU and RAM goes up to 100% when gradle is running and crashes every time I try to use emulator. When I type the code the program works fine. My Android Studio version is 2.2 right now. Any solution?

Crash on sleep after running eclipse with ADT plugin installed

I've been having issues for a while where my Windows 7 machine would blue-screen when I tried to put it to sleep. I ignored the issue and just avoided using sleep until I recently happened to figure out that the crash occurred only after I'd run Eclipse. By comparing with a fresh install and adding plugins individually, I was able to source the problem to the Android Development Tools plugin for Eclipse. If I run a fresh version of Eclipse with the Android plugin installed, then the next time I tell the machine to sleep it shows a blue screen instead. If I specifically remove the com.android.ide.eclipse.ddms_22.6.2.v201403212031-1085508.jar from the plugins directory, then the crash does not occur, although I of course lose the functionality of the plugin.
Now I'm at a loss. I can tell whats causing the problem but I have no idea how I can fix it if I want to continue to use the Android plugins in Eclipse. Does anyone have any advice on how to further troubleshoot this?
Edit: After reinstalling drivers, the crash appears to occur under the following specific condition: The old Motorola Droid II that I use as a backup testing device has USB drivers installed and is plugged in, and adb.exe is running (either while eclipse is running or after it has closed). Knowing that, I have the easy workarounds of unplugging the device or stopping the adb.exe process before putting the computer to sleep. Still no idea why there's a crash under those conditions, though.
Edit2: Since this hasn't been touched in a while, worth noting that it's an adb issue and not an eclipse issue (it occurs using Android Studio as well), so I've updated tags accordingly.

Categories

Resources