Detox android apk path not correct

The problem is that Bitrise does not find the apk although the apk is present by checking with remote access. The reason is that the apk path that Bitrise is using is wrong and it is also not the path that is specified inside the detox configuration.

This is where the apk is located using remote access: /Users/vagrant/git/android/app/build/outputs/apk/androidTest/prd/release/app-prd-release-androidTest.apk

This is the binaryPath inside the detox configuration:
android/app/build/outputs/apk/androidTest/prd/release/app-prd-release-androidTest.apk

This is the path where Bitrise is looking for the apk:
/Users/vagrant/git/android/app/build/outputs/apk/androidTest/androidTest/prdRelease/androidTest/app-prd-release-androidTest-androidTest.apk'

I am using four steps in the workflow:

  1. AVD Manager:
  • Device Profile: pixel
  • Android API Level: 26
  • OS Tag: google_apis
  1. Wait for Android Emulator

  2. Run Yarn Command:

  • Working Directory: $BITRISE_SOURCE_DIR
  • Yarn command: detox build --configuration android.release
  1. Run Yarn Command:
  • Working Directory: $BITRISE_SOURCE_DIR
  • Yarn command: detox test --configuration android.release --cleanup

This is the detox configuration:

"android.release": {
      "type": "android.apk",
      "build": "cd android && ./gradlew --no-daemon assemblePrd assembleAndroidTest -DtestBuildType=release && cd ..",
      "binaryPath": "android/app/build/outputs/apk/androidTest/prd/release/app-prd-release-androidTest.apk"
    }

How can I change the path so that Bitrise can find the apk?

Looks like adding testBinaryPath solved the issue.

"testBinaryPath": "android/app/build/outputs/apk/androidTest/prd/release/app-prd-release-androidTest.apk"

Glad that you were able to resolve this issue! Thank you so much for letting us know and for sharing your solution!