Android Instrumentation tests failed due to 'Process crashed.''

Hey,

we are trying to run our Instrumentation Compose tests(should be the same case as Esspresso tests) using the Virtual Device Testing for Android step. The testing devices launch successfully but then the test fails with this unhelpful explanation:

Test failed to run to completion. Reason: 'Instrumentation run failed due to 'Process crashed.''. Check device logcat for details

And

Waiting for test results
- Validating
- (1/1) running
- (0/1) running
=> Test finished
Test results:
Model    API Level   Locale   Orientation   Outcome                       
Pixel2   30          en       portrait      failure(Crashed)   

I couldn’t find anything useful in the logs but there were so many system errors that I might have missed something important.

Important thing to note is that when I run our tests directly in Firebase Test lab everything works as expected.

Here is our bitrise.yml and the workflow in question is health-ui-tests

format_version: '8'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
trigger_map:
- push_branch: master
  workflow: health-cached
- pull_request_target_branch: master
  workflow: health-cached
- pull_request_target_branch: project/*
  workflow: health-cached
- pull_request_source_branch: "*"
  pull_request_target_branch: release/*
  workflow: health
- tag: rc-*.*
  workflow: open-beta-builds
- tag: rc-*.*.*
  workflow: open-beta-builds
workflows:
  setup:
    steps:
    - script@1:
        inputs:
        - content: "sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac\nsudo
            update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java\n
            \  \nexport JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'\nenvman add
            --key JAVA_HOME --value '/usr/lib/jvm/java-11-openjdk-amd64'"
    - activate-ssh-key@4.0.5:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.26: {}
    - install-missing-android-tools@2.3.8:
        inputs:
        - gradlew_path: "$PROJECT_LOCATION/gradlew"
  health:
    steps:
    - build-router-start@0.14:
        inputs:
        - access_token: "$HEALTH_CHECKS_ACCESS_TOKEN"
        - verbose: 'yes'
        - workflows: |-
            health-tests
            health-compile
            health-linter
    - github-status@2.3.4:
        inputs:
        - status_identifier: Bitrise Health Checks
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run: []
  health-tests:
    steps:
    - android-unit-test@1.0.2:
        inputs:
        - arguments: ' -x ":sync-tests:testDebugUnitTest" ":architecture:test" "common:test"
            "database:test" "models:test"'
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Unit Tests
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup
    after_run:
    - teardown
  sync-integration-tests:
    steps:
    - android-unit-test@1.0.2:
        inputs:
        - module: sync-tests
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Unit Tests
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup
    after_run:
    - teardown
  health-compile:
    steps:
    - android-build@0.10.3:
        inputs:
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Compiler Check
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup
  health-linter:
    steps:
    - gradle-runner@1.9.6:
        inputs:
        - gradlew_path: "$PROJECT_LOCATION/gradlew"
        - gradle_task: spotlessKotlinCheck
    - github-status@2.3.4:
        inputs:
        - status_identifier: Linter Check
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup
  teardown:
    steps:
    - deploy-to-bitrise-io@1.13.1: {}
  nightly-builds:
    steps:
    - change-android-versioncode-and-versionname@1: {}
    - android-build@0.10.3:
        inputs:
        - build_type: aab
        - variant: release
    - sign-apk@1: {}
    - google-play-deploy@3:
        inputs:
        - service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL_URL"
        - package_name: com.toggl.giskard
        - track: internal
    before_run:
    - setup
  open-beta-builds:
    steps:
    - change-android-versioncode-and-versionname@1: {}
    - android-build@0.10.3:
        inputs:
        - build_type: aab
        - variant: release
    - sign-apk@1: {}
    - google-play-deploy@3:
        inputs:
        - service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL_URL"
        - package_name: com.toggl.giskard
        - track: public-beta
    before_run:
    - setup
  signed-build:
    steps:
    - change-android-versioncode-and-versionname@1: {}
    - android-build@0.10.3:
        inputs:
        - build_type: aab
        - variant: release
    - sign-apk@1: {}
    - deploy-to-bitrise-io@1.13.1: {}
    before_run:
    - setup
  debug-build:
    steps:
    - change-android-versioncode-and-versionname@1:
        inputs:
        - new_version_name: ''
    - android-build@0.10.3:
        inputs:
        - build_type: aab
        - variant: debug
    - deploy-to-bitrise-io@1.13.1: {}
    before_run:
    - setup
  setup-cached:
    steps:
    - script@1:
        inputs:
        - content: "sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac\nsudo
            update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java\n
            \  \nexport JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'\nenvman add
            --key JAVA_HOME --value '/usr/lib/jvm/java-11-openjdk-amd64'"
    - activate-ssh-key@4.0.5:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone@4.0.26: {}
    - cache-pull@2.5.0:
        inputs:
        - is_debug_mode: 'true'
    - install-missing-android-tools@2.3.8:
        inputs:
        - gradlew_path: "$PROJECT_LOCATION/gradlew"
  teardown-cached:
    steps:
    - deploy-to-bitrise-io@1.13.1: {}
    - cache-push@2.5.0:
        inputs:
        - is_debug_mode: 'true'
        - compress_archive: 'true'
  health-cached:
    steps:
    - build-router-start@0.14:
        inputs:
        - access_token: "$HEALTH_CHECKS_ACCESS_TOKEN"
        - verbose: 'yes'
        - workflows: |-
            health-tests-cached
            health-compile-cached
            health-linter-cached
        is_always_run: true
    - github-status@2.3.4:
        inputs:
        - status_identifier: Bitrise Health Checks
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run: []
  health-compile-cached:
    steps:
    - android-build@0.10.3:
        inputs:
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Compiler Check
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup-cached
    after_run:
    - teardown-cached
  health-linter-cached:
    steps:
    - gradle-runner@1.9.6:
        inputs:
        - gradlew_path: "$PROJECT_LOCATION/gradlew"
        - gradle_task: spotlessKotlinCheck
    - github-status@2.3.4:
        inputs:
        - status_identifier: Linter Check
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup-cached
    after_run:
    - teardown-cached
  health-tests-cached:
    steps:
    - android-unit-test@1.0.2:
        inputs:
        - arguments: ' -x ":sync-tests:testDebugUnitTest" ":architecture:test" "common:test"
            "database:test" "models:test"'
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Unit Tests
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup-cached
    after_run:
    - teardown-cached
  health-and-slow-tests:
    steps:
    - script@1:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            # fail if any commands fails
            set -e
            # debug log
            set -x

            # write your script here

            export RUN_SLOW_TESTS=true
            envman add --key RUN_SLOW_TESTS --value 'true'

            echo "Slow tests will run $RUN_SLOW_TESTS"

            # or run a script from your repository, like:
            # bash ./path/to/script.sh
            # not just bash, e.g.:
            # ruby ./path/to/script.rb
    - android-unit-test@1.0.2:
        inputs:
        - arguments: ' -x ":sync-tests:testDebugUnitTest" ":architecture:test" "common:test"
            "database:test" "models:test"'
        - variant: debug
    - github-status@2.3.4:
        inputs:
        - status_identifier: Unit Tests
        - auth_token: "$GITHUB_STATUS_KEY"
    before_run:
    - setup
    after_run:
    - teardown
  health-ui-tests:
    steps:
    - android-build-for-ui-testing@0:
        inputs:
        - variant: debug
        - module: app
    - virtual-device-testing-for-android@1:
        inputs:
        - test_devices: Pixel2,30,en,portrait
        - inst_test_runner_class: ''
        - num_flaky_test_attempts: '0'
        - test_type: instrumentation
    before_run:
    - setup
    after_run:
    - teardown
app:
  envs:
  - opts:
      is_expand: false
    PROJECT_LOCATION: "."
  - opts:
      is_expand: false
    MODULE: app
  - opts:
      is_expand: false
    VARIANT: ''

Thanks for any help :bowing_man:

1 Like

Hello @tomasvalenta :wave:

Can you please send us the log file or the URL of the related build and also enable Support Access on the Settings tab of the app ( Enabling the Bitrise Support user for your app | Bitrise DevCenter ) so that we can take a more in-depth look? :slight_smile:

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