# Instrumentation run failed due to 'Process crashed.'

**URL:** <https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841>\
**Category:** Builds\
**Created:** [February 18, 2017, 10:03am UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841 "2017-02-18T10:03:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![phienkaka](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/phienkaka/32/256_2.png) [@phienkaka](https://discuss.bitrise.io/u/phienkaka)\
**Post date:** [February 18, 2017, 10:03am UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/1 "2017-02-18T10:03:29Z")

</div>

I use this workflow below, however, sometime I got this error:

```auto
Tests on Android_Emulator(AVD) - 5.1.1 failed: Instrumentation run failed due to 'Process crashed.'

com.android.builder.testing.ConnectedDevice > No tests found.[Android_Emulator(AVD) - 5.1.1] FAILED 
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
:my-app:connectedAndroidTest FAILED

FAILURE: Build failed with an exception.

```

Sometime, everything works fine.  
My instrument test is very simple and I only do one test. Do you have any idea for that issue?

Here is my workflow:

```auto
MY_WORKFLOW:
    steps:
    - activate-ssh-key@3.1.1:
        title: Activate App SSH key
        inputs:
        - ssh_key_save_path: "$HOME/.ssh/steplib_ssh_step_id_rsa"
    - git-clone@3.4.1: {}
    - script@1.1.3:
        title: Copy Android Licenses
        inputs:
        - content: |-
            #!/bin/bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            echo y | android update sdk --no-ui --all --filter build-tools-23.0.2 | grep 'package installed'
            echo y | android update sdk --no-ui --all --filter addon-google_apis-google-22
            echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-google_apis-22 | grep 'package installed'
            if [-d "./android-licenses/"]; then
              rsync -avhP ./android-licenses/ "$ANDROID_HOME/licenses/"
            fi
    - create-android-emulator@1.0.0:
        inputs:
        - name: "$BITRISE_EMULATOR_NAME"
        - platform: android-22
        - custom_hardware_profile_content: ''
    - start-android-emulator@1.1.1: {}
    - gradle-runner@1.5.4:
        inputs:
        - gradle_file: "$BITRISE_PROJECT_PATH"
        - gradle_task: connectedAndroidTest
          opts:
            is_expand: false
    - script@1.1.3:
        title: Kill all emulators
        is_always_run: true
        inputs:
        - content: |-
            #!/bin/bash
            # fail if any commands fails
            set -e
            # debug log
            set -x
            ls -l /opt/android-sdk-linux/tools/
            adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done
    - deploy-to-bitrise-io@1.2.7:
        inputs:
        - deploy_path: "$BITRISE_SOURCE_DIR/my-app/build/reports/androidTests/connected/flavors/"
        - notify_user_groups: none
        - notify_email_list: ''
    before_run: 
    after_run: 

```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 18, 2017, 10:33am UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/2 "2017-02-18T10:33:54Z")

</div>

I’d suggest you to Google for:

> [@phienkaka](#):
>
> Instrumentation run failed due to ‘Process crashed.’

There can be quite a few reasons for this.

Another thing worth to try is to run the build locally, on your Mac/PC:

> [@How to debug your build locally / "It works on my Mac/PC but not on bitrise.io"](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392):
>
> If the build works on your local Mac/PC but not on [bitrise.io](https://www.bitrise.io), that’s usually because of uncommitted / gitignored files or a tool version difference. There can be other reasons, for example in case of iOS code signing errors it’s usually because a code signing file which is available on your Mac, but you did not upload it to [bitrise.io](https://www.bitrise.io) and so it’s not available there. In any case, the first steps you should try, preferably before you’d report the issue (as this will be the first thing we’ll ask…

> [@phienkaka](#):
>
> Sometime, everything works fine.

I think this can also mean that your app crashes during launching / before the test would start, but of course without the code it’s quite hard to debug or advise something better than to follow the local debugging guide (above).

---

<div class="post-metadata">

**Author:** ![phienkaka](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/phienkaka/32/256_2.png) [@phienkaka](https://discuss.bitrise.io/u/phienkaka)\
**Post date:** [February 18, 2017, 4:31pm UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/3 "2017-02-18T16:31:21Z")

</div>

Hi @viktorbenei, Thank you very much for you quick reply.  
I also google a lot for the issue, but I can not find any answer so I posted my question here.  
For run my build locally on Mac, I try and it always run successfully.  
I also try with docker (your article you sent) and it also run successfully every time.  
I believe the app doesn’t crash because the test only run fail in Bitrise. Can you help me?  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 18, 2017, 10:06pm UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/4 "2017-02-18T22:06:43Z")

</div>

> [@phienkaka](#):
>
> I believe the app doesn’t crash because the test only run fail in Bitrise.

If it runs good locally using docker then it’s not Bitrise, it’s more likely something like the amount of RAM.

How much RAM do you have on your Mac?

---

<div class="post-metadata">

**Author:** ![phienkaka](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/phienkaka/32/256_2.png) [@phienkaka](https://discuss.bitrise.io/u/phienkaka)\
**Post date:** [February 19, 2017, 8:46am UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/5 "2017-02-19T08:46:32Z")

</div>

My Mac Ram is 16 GB, 1600 MHZ (DDR3)  
My Mac Proccessor is: 2.5 GHz Intel Core i7.

My docker setting up is:  
8GB Memory

---

<div class="post-metadata">

**Author:** ![phienkaka](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/phienkaka/32/256_2.png) [@phienkaka](https://discuss.bitrise.io/u/phienkaka)\
**Post date:** [February 19, 2017, 10:52am UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/6 "2017-02-19T10:52:53Z")

</div>

Hi @viktorbenei,  
I think you are right, seem like the issue cause by the memory of Ram we use.  
When I share docker with only 2G memory, I can not run successfully,  
However, when I change to 3G, every build is success.  
Do you know how much memory of Ram we use in Bitrise?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 19, 2017, 12:19pm UTC](https://discuss.bitrise.io/t/instrumentation-run-failed-due-to-process-crashed/841/7 "2017-02-19T12:19:29Z")

</div>

On Linux/Android you have 7.5GB RAM, and on the Mac stacks you have 4GB RAM.

If RAM is the issue, you can try to limit RAM usage of JVM for example, see: [http://devcenter.bitrise.io/android/android-tips-and-tricks/#memory-ram-limit](http://devcenter.bitrise.io/android/android-tips-and-tricks/#memory-ram-limit)

Another option can be that we now have more powerful configurations (with double RAM, 15 GB and 8 GB). If you’re interested we can invite you to the private beta, but these configs will cost more once publicly available (in the next couple of weeks).
