Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

detox app could not be found, did you run './gradlew assembleAndroidTest'?

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 enter image description here

like image 573
Krupanand K Avatar asked Oct 29 '25 09:10

Krupanand K


2 Answers

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.

like image 144
Freewalker Avatar answered Oct 31 '25 02:10

Freewalker


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
like image 24
Andrew Avatar answered Oct 31 '25 00:10

Andrew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!