# Detox Build issue

**URL:** <https://discuss.bitrise.io/t/detox-build-issue/19557>\
**Category:** Builds\
**Tags:** android\
**Created:** [March 8, 2022, 9:43am UTC](https://discuss.bitrise.io/t/detox-build-issue/19557 "2022-03-08T09:43:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shalini\_healint](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@shalini\_healint](https://discuss.bitrise.io/u/shalini_healint)\
**Post date:** [March 8, 2022, 9:43am UTC](https://discuss.bitrise.io/t/detox-build-issue/19557/1 "2022-03-08T09:43:15Z")

</div>

## Description of the issue

I am trying to run Detox tests for Android App. It works in local. But when I run in bitrise it is stuck and getting timeout eventually. Detox build is successful and apk is generated successfully. I tried with Android ubuntu stack as well and tried multiple images like google\_apis, google\_apis\_playstore,default, different android images. It doesnt help.

## Environment:

**Where did the issue happen?**

Stack : XCode 13.0.x, Mac OS 11.4(Big Sur)  
Xcode : 13.0.x  
Detox: 19.3.1

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

## Highlighted step is where failing. (detox tests)

> format\_version: ‘11’  
> default\_step\_lib\_source: [GitHub - bitrise-io/bitrise-steplib: New Bitrise StepLib](https://github.com/bitrise-io/bitrise-steplib.git)  
> project\_type: react-native  
> trigger\_map:
> 
> - push\_branch: MBI-7610  
> workflow: tests  
> workflows:  
> tests:  
> steps:
> - activate-ssh-key@4: {}
> - git-clone@6: {}
> - nvm@1: {}
> - yarn:  
> inputs:
> - command: install  
> title: Yarn Install
> 
> - script:  
> inputs:
> - is\_debug: ‘yes’
> - content: "#!/bin/bash\n\nyarn global add envinfo detox-cli && envinfo\nbrew  
> tap wix/brew && brew install applesimutils "  
> title: Install Detox CLI
> 
> - avd-manager@1:  
> inputs:
> - name: “$EMULATOR\_NAME”
> - abi: x86\_64
> - profile: pixel\_3a
> - emulator\_channel: ‘2’
> - tag: google\_apis
> - emulator\_id: Pixel\_3a\_API\_30\_x86
> - api\_level: ‘30’
> 
> - wait-for-android-emulator@1:  
> inputs:
> - boot\_timeout: ‘360000’
> 
> - script:  
> inputs:
> - is\_debug: ‘yes’
> 
> - content: |-  
> #!/bin/bash
> 
> - script:  
> inputs:
> - is\_debug: ‘yes’
> 
> - content: |-  
> #!/bin/bash
> 
> - opts:  
> is\_expand: false  
> WORKDIR: “.”
> - PROJECT\_LOCATION: android  
> opts:  
> is\_expand: false
> - EMULATOR\_NAME: Pixel\_3a\_API\_30\_x86  
> outputs:
> 
> - BITRISE\_APK\_PATH: android/app/build/outputs/apk/alpha/debug/app-alpha-debug.apk  
> opts:  
> title: Path of the generated APK  
> summary: Path of the generated (and copied) APK - after filtering.  
> description: |-  
> This output will include the path of the generated APK  
> after filtering based on the filter inputs.  
> If the build generates more than one APK which fulfills the  
> filter inputs, this output will contain the last one’s path.

## 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)_ : NO
- _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)._ : NO
- _Does the issue happen sporadically, or every time?_ : YES
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ :First time trying

### 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._

Unable to start Android Manager using bitrise cli. But running detox commands is successful.

### 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/) ._

The link to run in local with docker is not found.

## 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._

detox[6151] DEBUG: [SPAWN\_CMD, #6228] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:40157 -e detoxSessionId a8e9635f-3e90-6751-999f-2aa57f6255e2 -e debug false com.app/androidx.test.runner.AndroidJUnitRunner  
detox[6151] DEBUG: [EXEC\_CMD, #21] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “ps | grep "com.app$"”  
detox[6151] DEBUG: [SPAWN\_CMD, #6233] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell “logcat -T "03-06 17:31:52.000" --pid=2962 -f /sdcard/17315215\_0.log”  
detox[6151] DEBUG: [EXEC\_CMD, #22] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell du /sdcard/17315215\_0.log  
detox[6151] DEBUG: [WSS\_CONNECTION, #43447] registered a new connection.  
detox[6151] DEBUG: [APP\_STATUS] Failed to execute the current status query.  
detox[6151] INFO: Onboarding: should have welcome screen  
detox[6151] INFO: Onboarding: should have welcome screen [FAIL]  
detox[6151] INFO: Onboarding: should show login screen after tap  
detox[6151] INFO: Onboarding: should show login screen after tap [FAIL]  
detox[6151] INFO: Onboarding: should show signup screen after tap  
detox[6151] INFO: Onboarding: should show signup screen after tap [FAIL]  
detox[6151] INFO: Onboarding: should show forgot password screen after tap  
detox[6151] INFO: Onboarding: should show forgot password screen after tap [FAIL]  
detox[6151] DEBUG: [EXEC\_CMD, #23] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “date +"%m-%d %T.000"”  
detox[6151] DEBUG: [SPAWN\_END, #6233] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell “logcat -T "03-06 17:31:52.000" --pid=2962 -f /sdcard/17315215\_0.log” terminated with SIGINT  
detox[6151] DEBUG: [EXEC\_CMD, #24] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 pull “/sdcard/17315215\_0.log” “artifacts/android27.2022-03-06 17-31-02Z/emulator-5554 2022-03-06 17-33-52Z.startup.log”  
detox[6151] DEBUG: [EXEC\_CMD, #25] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 shell “rm "/sdcard/17315215\_0.log"”  
detox[6151] DEBUG: [MOVE\_FILE] moving “/tmp/050217f6-2a0a-4333-ac14-101cd8f6db6b.detox.log” to artifacts/android27.2022-03-06 17-31-02Z/detox\_pid\_6151.json.log  
detox[6151] DEBUG: [MOVE\_FILE] moving “/tmp/8ca4db06-db3d-481b-b7c2-079321ca71a6.detox.log” to artifacts/android27.2022-03-06 17-31-02Z/detox\_pid\_6151.log  
detox[6151] WARN: [PENDING\_REQUESTS] The app has not responded to the network requests below:  
(id = 1) currentStatus: {}  
(id = -1000) isReady: {}  
Unresponded network requests might result in timeout errors in Detox tests.  
detox[6151] ERROR: [Client.js/ERROR] The pending request #-49642 (“cleanup”) has been rejected due to the following error:  
The tester has not received a response within 5000ms timeout to the message:  
Cleanup {  
type: ‘cleanup’,  
params: [Object],  
messageId: -49642  
}  
detox[6151] DEBUG: [SPAWN\_END, #6228] /opt/android-sdk-linux/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:40157 -e detoxSessionId a8e9635f-3e90-6751-999f-2aa57f6255e2 -e debug false com.app.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT  
detox[6151] DEBUG: [EXEC\_CMD, #26] “/opt/android-sdk-linux/platform-tools/adb” -s emulator-5554 reverse --remove tcp:40157  
detox[6151] DEBUG: [WSS\_CLOSE] Detox server has been closed gracefully  
FAIL e2e/onboarding.e2e.js (174.182 s)  
Onboarding  
✕ should have welcome screen (1 ms)  
✕ should show login screen after tap  
✕ should show signup screen after tap  
✕ should show forgot password screen after tap  
● Onboarding › should have welcome screen  
thrown: “Exceeded timeout of 120000 ms for a hook.  
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”  
1 | describe(‘Onboarding’, () =\> {  
\> 2 | beforeAll(async () =\> {  
| ^  
3 | console.log(“awaiting launch app”);  
4 | await device.launchApp({ newInstance: true });  
5 | console.log(“done launch app”);  
at onboarding.e2e.js:2:3  
at Object. (onboarding.e2e.js:1:1)  
● Onboarding › should show login screen after tap  
thrown: “Exceeded timeout of 120000 ms for a hook.  
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”  
1 | describe(‘Onboarding’, () =\> {  
\> 2 | beforeAll(async () =\> {  
| ^  
3 | console.log(“awaiting launch app”);  
4 | await device.launchApp({ newInstance: true });  
5 | console.log(“done launch app”);  
at onboarding.e2e.js:2:3  
at Object. (onboarding.e2e.js:1:1)  
● Onboarding › should show signup screen after tap  
thrown: “Exceeded timeout of 120000 ms for a hook.  
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”  
1 | describe(‘Onboarding’, () =\> {  
\> 2 | beforeAll(async () =\> {  
| ^  
3 | console.log(“awaiting launch app”);  
4 | await device.launchApp({ newInstance: true });  
5 | console.log(“done launch app”);  
at onboarding.e2e.js:2:3  
at Object. (onboarding.e2e.js:1:1)  
● Onboarding › should show forgot password screen after tap  
thrown: “Exceeded timeout of 120000 ms for a hook.  
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.”  
1 | describe(‘Onboarding’, () =\> {  
\> 2 | beforeAll(async () =\> {  
| ^  
3 | console.log(“awaiting launch app”);  
4 | await device.launchApp({ newInstance: true });  
5 | console.log(“done launch app”);  
at onboarding.e2e.js:2:3  
at Object. (onboarding.e2e.js:1:1)  
detox[6139] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern ‘^((?!:android:).)\*$’ jest e2e

---

<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:** [April 7, 2022, 9:44am UTC](https://discuss.bitrise.io/t/detox-build-issue/19557/2 "2022-04-07T09:44:15Z")

</div>

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