Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App is installed on the android emulator but unable to launch and app run the test cases - Detox 7.3.4 #695

Closed
DVLNarayana opened this issue Apr 26, 2018 · 14 comments

Comments

@DVLNarayana
Copy link

DVLNarayana commented Apr 26, 2018

Description

App is installing on the android emulator but unable to run the test cases with latest detox version 7.3.4

Steps to Reproduce

Done the setup as per this link https://github.com/wix/detox/blob/master/docs/Introduction.Android.md

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.4
  • React Native: 55.3
  • Node: 8.11.1
  • Device: emulator : Nexus_5X_API_25_x86
  • Xcode: -
  • macOS: 10.13.4

Device and verbose Detox logs

  • detox info 17:38:32: server listening on localhost:54867...
  • detox verb ws onOpen [object Object]
  • detox verb ws send: {"type":"login","params":{"sessionId":"280f9c44-0148-8b86-918a-3c8607526482","role":"tester"},"messageId":0}
  • detox verb ws onMessage: {"type":"loginSuccess","params":{"sessionId":"280f9c44-0148-8b86-918a-3c8607526482","role":"tester"},"messageId":0}
  • detox verb ws
  • detox verb 1: /Users/mobility/Library/Android/sdk/tools/emulator -list-avds --verbose
  • detox verb 1: stdout: Nexus_5X_API_25_x86
  • detox verb 1: stdout:
  • detox verb /Users/mobility/Library/Android/sdk/tools/emulator -verbose -gpu host -no-audio @Nexus_5X_API_25_x86
  • detox verb 2: /Users/mobility/Library/Android/sdk/platform-tools/adb devices
  • detox verb 2: stdout: List of devices attached
  • detox verb 2: stdout: emulator-5554 device
  • detox verb 2: stdout:
  • detox verb 2: stdout:
  • detox verb 3: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop dev.bootcomplete
  • detox verb 3: stdout: 1
  • detox verb 3: stdout:
  • detox verb 4: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell input keyevent 82
  • detox verb 5: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.abc.sampleproject
  • detox verb 5: stdout: Success
  • detox verb 5: stdout:
  • detox verb 6: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 uninstall com.abc.sampleproject.test
  • detox verb 6: stderr:
  • detox verb 6: stderr: Exception occurred while dumping:
  • detox verb 6: stderr: java.lang.IllegalArgumentException: Unknown package: com.abc.sampleproject.test
  • detox verb 6: stderr: at com.android.server.pm.Settings.isOrphaned(Settings.java:4134)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18105)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:15522)
  • detox verb 6: stderr: at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:888)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
  • detox verb 6: stderr: at android.os.ShellCommand.exec(ShellCommand.java:94)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18363)
  • detox verb 6: stderr: at android.os.Binder.shellCommand(Binder.java:468)
  • detox verb 6: stderr: at android.os.Binder.onTransact(Binder.java:367)
  • detox verb 6: stderr: at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
  • detox verb 6: stderr: at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3031)
  • detox verb 6: stderr: at android.os.Binder.execTransact(Binder.java:565)
  • detox verb 6: stderr:
  • detox verb 7: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk
  • detox verb 7: stdout: 25
  • detox verb 7: stdout:
  • detox verb 8: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/mobility/Narayana/ReactNative/RNServiceTag/branches/ServiceTagRN/android/app/build/outputs/apk/debug/app-debug.apk
  • detox verb 8: stdout: Success
  • detox verb 8: stdout:
  • detox verb 9: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell getprop ro.build.version.sdk
  • detox verb 9: stdout: 25
  • detox verb 9: stdout:
  • detox verb 10: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 install -r -g /Users/mobility/Narayana/ReactNative/RNServiceTag/branches/ServiceTagRN/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
  • detox verb 10: stdout: Success
  • detox verb 10: stdout:
  • detox verb 11: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am force-stop com.abc.sampleproject
  • detox verb 12: /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell pm list instrumentation
  • detox verb 12: stdout: instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
  • detox verb 12: stdout: instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
  • detox verb 12: stdout: instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
  • detox verb 12: stdout: instrumentation:com.abc.sampleproject.test/android.support.test.runner.AndroidJUnitRunner (target=com.abc.sampleproject)
  • detox verb 12: stdout: instrumentation:org.chromium.webview_shell/.WebViewLayoutTestRunner (target=org.chromium.webview_shell)
  • detox verb 12: stdout:
  • detox verb /Users/mobility/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:54867 -e detoxSessionId 280f9c44-0148-8b86-918a-3c8607526482 -e debug false com.abc.sampleproject.test/android.support.test.runner.AndroidJUnitRunner
  • detox verb Instrumentation spawned, childProcess.pid: 67895
  • detox verb ws send: {"type":"isReady","params":{},"messageId":-1000}
  • detox verb Instrumentation stdout: INSTRUMENTATION_RESULT: stream=
  • detox verb Instrumentation stdout:
  • detox verb Instrumentation stdout: Time: 0.001
  • detox verb Instrumentation stdout:
  • detox verb Instrumentation stdout: OK (0 tests)
  • detox verb Instrumentation stdout:
  • detox verb Instrumentation stdout:
  • detox verb Instrumentation stdout: INSTRUMENTATION_CODE: -1
  • detox verb Instrumentation stdout:
  • detox verb instrumentationProcess terminated due to receipt of signal null
  • 0 passing (2m)
    1. "before all" hook

Screenshorts :
image
image
image

@vonovak
Copy link
Contributor

vonovak commented Apr 26, 2018

@DVLNarayana just wondering, what makes you think RN 0.55.3 is supported? Last time I checked it wasn't.

@cris-santos
Copy link

@vonovak Where can we check the supported versions?

@joegoodall1
Copy link
Contributor

It's a bit unclear (at least to me) what versions of Android are supported.

Detox Android, until recently, didn't support RN >= 50 as noted here but now I think up to RN51 is supported.

Not sure if there is any progress past these versions.

@noomorph
Copy link
Collaborator

noomorph commented May 3, 2018

Could you create a public GitHub repository that reproduces your error and link it here, please?

@tachtevrenidis
Copy link

@DVLNarayana, I don't know if this is your issue, but I was stuck at this exact error for a day or two and what got me to move past it was to rename the folder I was using for the detox test from src/test/com/xxx/DetoxTest.java to src/testAndroid/com/xxx/DetoxTest.java

@stevesouth
Copy link

Same issue here. I've tried

src/testAndroid/com/xxx/DetoxTest.java
src/androidTest/com/xxx/DetoxTest.java
src/androidTest/com/xxx/test/DetoxTest.java

with no joy.

@markhu
Copy link

markhu commented Jun 26, 2018

AFAIK, Android support for Wix Detox is stuck back at React Native v0.51 per issue #608 bumped RN support from 0.50.0 to 0.51.0 in early April. So at this point, Wix Detox is 6 months behind on Android.

@lalka-workco
Copy link
Contributor

lalka-workco commented Jun 26, 2018

@DVLNarayana I am currently able to run Android on RN 0.55.4 with Detox 7.3.7. I went through my installation and verified that all the configurations per the instructions were correct. My best guess my looking at your error message might be that there is an error around Step 3.

I noticed that your screenshot complains about com.abc.sampleproject.test not defined. I am not too sure of what is happening at this step, but my guess is either there is a test folder missing from the project, or Step 3 of the Android Instructions states to copy the DetoxTest.java file over but you must make sure that you have correctly changed your package name. The file can be located here

Let me know if that helps

@hkung77
Copy link

hkung77 commented Jun 28, 2018

I'm also receiving similar errors. I had to do some additional steps just to get it to compile.
Are theses steps missing from the android instructions?

I had to include the lines in app/build.gradle

    sourceSets {
         androidTest.setRoot('src/main')
    }

Also when trying to build I wasn't able to build it using the flag -DtestBuildType=release because proguard was blocking me.

I'm on RN 0.51.1, detox: 7.4.3

error log:

5: Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.example.app
	at com.android.server.pm.Settings.isOrphaned(Settings.java:4409)
	at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:22182)
	at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:19101)
	at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:745)
	at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:929)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:134)
	at android.os.ShellCommand.exec(ShellCommand.java:96)
	at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22482)
	at android.os.Binder.shellCommand(Binder.java:594)
	at android.os.Binder.onTransact(Binder.java:492)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2658)
	at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3790)
 	at android.os.Binder.execTransact(Binder.java:697), exited with code 255
6: Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.example.app.test
	at com.android.server.pm.Settings.isOrphaned(Settings.java:4409)
	at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:22182)
	at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:19101)
	at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:745)
	at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:929)
	at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:134)
	at android.os.ShellCommand.exec(ShellCommand.java:96)
	at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22482)
	at android.os.Binder.shellCommand(Binder.java:594)
	at android.os.Binder.onTransact(Binder.java:492)
	at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2658)
	at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3790)
 	at android.os.Binder.execTransact(Binder.java:697), exited with code 255


android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk' could not be found, did you run './gradlew assembleAndroidTest' ?

@carlosvega20
Copy link

carlosvega20 commented Jun 29, 2018

same issue here

Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.rn_hub
        at com.android.server.pm.Settings.isOrphaned(Settings.java:4409)
        at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:22197)
        at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:19116)
        at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:745)
        at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:929)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:134)
        at android.os.ShellCommand.exec(ShellCommand.java:96)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22497)
        at android.os.Binder.shellCommand(Binder.java:594)
        at android.os.Binder.onTransact(Binder.java:492)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2658)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3773)
        at android.os.Binder.execTransact(Binder.java:697)

6: running "/Users/carlosvega/Library/Android/sdk/platform-tools/adb -s emulator-5556 uninstal
  com.rn_hub.test" returned 255
6: stderr:
Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.rn_hub.test
        at com.android.server.pm.Settings.isOrphaned(Settings.java:4409)
        at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:22197)
        at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:19116)
        at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:745)
        at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:929)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:134)
        at android.os.ShellCommand.exec(ShellCommand.java:96)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22497)
        at android.os.Binder.shellCommand(Binder.java:594)
        at android.os.Binder.onTransact(Binder.java:492)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2658)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3773)
        at android.os.Binder.execTransact(Binder.java:697)

@carlosvega20
Copy link

@hkung77 in your log at the end said:
android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk' could not be found

make sure the apk is there, in my case I found it in a parent directory instead:
android/app/build/outputs/apk/my-app.apk

@stale
Copy link

stale bot commented Aug 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added 🏚 stale and removed 🏚 stale labels Aug 13, 2018
@stale
Copy link

stale bot commented Sep 28, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions.

@stale stale bot added the 🏚 stale label Sep 28, 2018
@stale
Copy link

stale bot commented Oct 5, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Oct 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests