Detox: Error: No instrumentation runner found on device emulator-19386 for package com.package.flavour.test
Describe the bug Followed the instructions and tried to fix this for several days. Running debug test shows Error: No instrumentation runner found on device emulator-19386 for package com.package.flavor.test I’m using flavours.
There are several issues on this that are closed with your bot, with seemingly no answer.
To Reproduce Use flavours and follow the documentation.
Use testBinaryPath because for some reason just having the binaryPath, Detox doesn’t just read it, it adds random folders in the middle of the path you defined:
binaryPath: android/app/build/outputs/apk/androidTest/flavour/debug/app-flavour-debug-androidTest.apk
Error: android/app/build/outputs/apk/androidTest/androidTest/WorkcoDebug/androidTest/app-Workco-debug-androidTest-androidTest.apk’ could not be found, did you run ‘./gradlew assembleAndroidTest’?
With testBinaryPath it uses the correct path but you have to have binaryPath set as well for some reason.
- I have tested this issue on the latest Detox release and it still reproduces
Steps to reproduce:
- Follow documentation
- Use on a flavour
- See it not work
Expected behavior
Tests run
Device and Verbose Detox Logs
detox[89859] DEBUG: [exec.js/EXEC_CMD, #11] “/Users/me/Library/Android/sdk/platform-tools/adb” -s emulator-19386 shell “pm list packages com.package.flavour.test.test”
Is this meant to have two test?
Environment (please complete the following information):
- Detox: latest
- React Native: 0.60.5
- Node: 12
- Device: emulator
- OS: MacOs
- Test-runner (select one):
jest-circus
|jest-jasmine2
(deprecated) |mocha
jest-circus
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 21
Commits related to this issue
- fix: corrected path to binary FIxed path issues as per https://github.com/wix/Detox/issues/2436 — committed to anderslundback/detoxrn by anderslundback 4 years ago
- build(detoxrc): fix testBinaryPath used by Android E2E ``` The test APK could not be found at path: '/Users/runner/work/react-native-cli-quickstart/react-native-cli-quickstart/android/app/build/outp... — committed to remarkablemark/react-native-cli-quickstart by remarkablemark a year ago
I solved this issue by changing the android configuration as follows. It helps to solve your issue.
Please be sure that
binaryPath
indicates your app APK’s path andtestBinaryPath
indicates your androidTest APK’s path.Yes, that indeed confirms it:
Change it to your app APK’s path.
@anderslundback could you copy&paste your Detox configuration here? According to the logs (and detox code), you’ve erroneously used your test APK for your app’s APK under
binaryPath
. Please double check that.Hello, I’m having the same issue.
I have tried running on both an attached android device and various emulators. I have also tried with jest + jest-circus instead of mocha with various versions.
Following the advice of @d4vidi I have also verified that DetoxTest.java is in fact included in my apk. Please see detox logs below with log level: trace. Thank you for taking the time. Please let me know if I can provide any further information.
node: 14.4.0 java: 1.8.0_242 detox: 17.13.2 mocha: 6.1.3 react: 16.13.1 react-native: 0.63.3
Error: No instrumentation runner found on device emulator-11498 Same issue here, with Pixel 4 emulator and an Expo app.
Any solution ?