Android TIMEOUT "took more than 10 minutes since last output"

I am getting the message

Building 98%9% > :app:connectedProductDebugAndroidTest command ./gradlew connectedProductDebugAndroidTest -PdisablePreDex took more than 10 minutes since last output

where ProductDebug is the build variants so connectedProductDebugAndroidTest is the same as connectedAndroidTest as explained in https://circleci.com/docs/android/#running-tests-against-the-emulator .

Below is our circle.yml file:

machine:
  timezone: Asia/Tokyo
  java:
    version: oraclejdk8
  environment:
    ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
  override:
    - echo y | android update sdk --no-ui --all --filter "platform-tools, tools"
    - echo y | android update sdk --no-ui --all --filter "android-22, build-tools-22.0.1"
    - echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
    - echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"
    - echo y | android update sdk --no-ui --all --filter "extra-android-support"

test:
  pre:
    - mksdcard -l sdcard 10M sdcard.img
    - emulator -avd circleci-android22 -sdcard sdcard.img -noskin -noaudio -no-window -no-boot-anim -nojni -no-accel:
        background: true
        parallel: true
    - circle-android wait-for-boot
  override:
    - ./gradlew connectedProductDebugAndroidTest -PdisablePreDex
  post:
    - cp -R app/build/reports/androidTests/connected/flavors/product/* $CIRCLE_ARTIFACTS
    - cp app/build/outputs/apk/* $CIRCLE_ARTIFACTS

You may find it helpful to look at my circle.yml file. https://github.com/ismail-s/JTime/blob/master/circle.yml it contains code to unlock the emulator, as well as to take screenshots of the emulator as, when builds don’t pass, it can be due to the emulator being locked, or some random dialog being open on the emulator.