Error: No instrumentation runner found on device emulator-19386 for package com.package.flavour.test

See original GitHub issue

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:

  1. Follow documentation
  2. Use on a flavour
  3. 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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:15

github_iconTop GitHub Comments

6reactions
yasemincidemcommented, Aug 25, 2021

I solved this issue by changing the android configuration as follows. It helps to solve your issue.

 "android.debug": {
      "type": "android.apk",
      "binaryPath": "android/app/build/outputs/apk/debug/app-x86-debug.apk",
      "testBinaryPath": "android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk",
      "build": "cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd .."
 }

Please be sure that binaryPath indicates your app APK’s path and testBinaryPath indicates your androidTest APK’s path.

3reactions
d4vidicommented, Dec 7, 2020

Yes, that indeed confirms it:

      "binaryPath": "android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk",

Change it to your app APK’s path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No instrumentation runner found on device emulator-5556 for ...
However I was having this same error while trying to run Detox test locally and it took me a while to figure out...
Read more >
Troubleshooting instrumentation tests in AWS Device Farm
Make sure that you can unzip the test package without errors. ... We could not find the instrumentation runner value in the AndroidManifest.xml....
Read more >
Exploring AndroidJUnitRunner filtering options - Medium
This article uncovers the magic behind AndroidJUnitRunner filtering options and explains how runner arguments work.
Read more >
How to group Android tests
Let's explore a sequence of steps to run instrumentation tests with ADB commands. Let's assume that our app has the "com.alexzh.testapp" package ......
Read more >
AndroidJUnitRunner - Android Developers
The test runner handles loading your test package and the app under test to a device, running your tests, and reporting test results....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found