I am doing detox test for react native android version 0.57. I am getting this error.
Error is
Error: 'D:\folder\android\app\build\outputs\apk\androidTest\dev\debug\app-dev-debug-androidTest.apk' could not be found, did you run './gradlew assembleAndroidTest' ?
Package.json
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/dev/debug/app-dev-debug.apk",
"build": "cd android && .\\gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.attached",
"name": "192.168.83.101:5555"
}
Error picture

Detox has strange behavior where it mutates your path to your apk, if you specify it using binaryPath.
To specify the exact path to your apk, add an entry for testBinaryPath that points to the APK you want Detox to use.
This error is usually caused but not having built the test apk. It can usually be resolved by running
detox build -c android.emu.debug
If you make changes to your application you should always run the above script before running any test.
I usually run the following script to make sure that the build is uptodate before testing.
detox build -c android.emu.debug && detox test -c android.emu.debug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With