# Android Fastlane fails while running on emulators

**URL:** <https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884>\
**Category:** Builds\
**Created:** [April 29, 2019, 2:17pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884 "2019-04-29T14:17:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sowjanya-gurajada-Mi](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sowjanya-gurajada-Mi](https://discuss.bitrise.io/u/sowjanya-gurajada-Mi)\
**Post date:** [April 29, 2019, 2:17pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/1 "2019-04-29T14:17:09Z")

</div>

# Bitrise Build Issue Report template

## Description of the issue

I’m trying to configure fastlane for Android.  
Have configured the workflow as follows:

Git clone → Launch AVD Manager → Generate Gradle wrapper → Install missing Android SDK components → Android build for UI testing → Added script to run ./gradlew assembleDebug assembleAndroidTest → Fastlane step

The build gets failed at Fastlane step at this point:  
/opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell echo $EXTERNAL\_STORAGE

I tried to reconfigure in multiple ways based on your forums and other references, but in any way, it fails at this point. Really need your help to pass through this step as this is blocking our builds.  
Also, tried to run this step manually as a script, still didn’t proceed further.

## Environment:

Android

If on [Bitrise.io](http://Bitrise.io): which stack? If not on [Bitrise.io](http://Bitrise.io): on what operating system? (Plus any other information you can share)  
Default ( Android & Docker, on Ubuntu 16.04)

**Which build Step causes the issue and which version of the step?**  
Fastlane 2.4.0

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : Rebuild tried several times, didn’t work
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : YES/NO
- _Does the issue happen sporadically, or every time?_ : Every time
- _Does upgrading the build Step to the latest version help?_ : Using the latest version
- _When did the issue start?_ : From the time of adding fastlane step into workflow and starting emulators

### Local reproduction

_Can it be reproduced on your own Mac/PC by following our [local debug guide](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what [bitrise.io](http://bitrise.io) will get when it does a git clone in the clean environment! If possible please note which sections you tried._

– Locally fastlane works very well.. just the bundle exec fastlane works everything fine.

### Local reproduction: Linux / Android (docker based) stack builds

_Can it be reproduced by running the build locally, after doing a new git clone of the repository into the `/tmp` directory and running the build from there with the Bitrise CLI ( [Bitrise CLI](https://www.bitrise.io/cli) )? If no, can it be reproduced with Docker (using the same docker images / environment we use on [bitrise.io](http://bitrise.io))? Related guide: [Running your build locally in Docker](http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/) ._

## Build log

_Please copy paste the build’s [bitrise.io](http://bitrise.io) URL here (or if the issue happens somewhere else then the full logs), or if you can’t share the url / log here then send the url or full log through a private channel (e.g. email - [Contact us](https://www.bitrise.io/contact) ), with a link to the related Discuss issue._

FYR:

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

[Log in - Bitrise](https://app.bitrise.io/build/3010ddf52e81967f) (Added that command as separate script)

---

<div class="post-metadata">

**Author:** ![sowjanya-gurajada-Mi](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sowjanya-gurajada-Mi](https://discuss.bitrise.io/u/sowjanya-gurajada-Mi)\
**Post date:** [April 29, 2019, 2:22pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/2 "2019-04-29T14:22:00Z")

</div>

Latest build:

> **[Bitrise - Mobile Continuous Integration and Delivery](https://app.bitrise.io/users/sign_in)**
>
> Mobile Continuous Integration and Delivery for your whole team, with dozens of integrations for your favourite services.

---

<div class="post-metadata">

**Author:** ![sowjanya-gurajada-Mi](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sowjanya-gurajada-Mi](https://discuss.bitrise.io/u/sowjanya-gurajada-Mi)\
**Post date:** [April 29, 2019, 2:28pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/3 "2019-04-29T14:28:04Z")

</div>

> **[Bitrise - Mobile Continuous Integration and Delivery](https://app.bitrise.io/users/sign_in)**
>
> Mobile Continuous Integration and Delivery for your whole team, with dozens of integrations for your favourite services.

emulators that got started in the initial step were turning offline when fastlane needed.

---

<div class="post-metadata">

**Author:** ![sowjanya-gurajada-Mi](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sowjanya-gurajada-Mi](https://discuss.bitrise.io/u/sowjanya-gurajada-Mi)\
**Post date:** [April 29, 2019, 4:18pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/4 "2019-04-29T16:18:36Z")

</div>

Cache pull/push disabled; tried with single emulator. still it stucks at the same step:

> **[Bitrise - Mobile Continuous Integration and Delivery](https://app.bitrise.io/users/sign_in)**
>
> Mobile Continuous Integration and Delivery for your whole team, with dozens of integrations for your favourite services.

---

<div class="post-metadata">

**Author:** ![sowjanya-gurajada-Mi](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@sowjanya-gurajada-Mi](https://discuss.bitrise.io/u/sowjanya-gurajada-Mi)\
**Post date:** [April 29, 2019, 9:27pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/5 "2019-04-29T21:27:05Z")

</div>

Tried this as well:

- adb kill-server

- adb start-server

- daemon not running; starting now at tcp:5037

- daemon started successfully

- adb devices

List of devices attached

emulator-5554 offline

- adb -s emulator-5554 shell echo ‘$EXTERNAL\_STORAGE’

error: device offline

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [May 29, 2019, 9:27pm UTC](https://discuss.bitrise.io/t/android-fastlane-fails-while-running-on-emulators/8884/6 "2019-05-29T21:27:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
