AGP 3.4.0 doesn't play with Android Test Orchestrator (not AndroidX version): ERROR: could not find class 'android.support.test.services.shellexecutor.ShellMain'
See original GitHub issueDescription
I’m not sure if this is a Testing issue or an AGP issue.
Running instrumentation tests with AGP 3.4.0 and Test Orchestrator 1.0.2 causes process crash.
Steps to Reproduce
I have repro steps and a reproducible repo here https://github.com/tir38/android-test-orchestrator-bug
- create brand new A/S project
- see that AGP is set to ‘com.android.tools.build:gradle:3.4.0-beta05’
- add Android Test Orchestrator to project (not the AndroidX version)
- start up an emulator
- run the instrumentation test that was included in brand new project:
$ ./gradlew clean app:connectedDebugAndroidTest
- see the tests fail:
Task :app:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:app:connectedDebugAndroidTest’. There were failing tests. See the report at: file:…/app/build/reports/androidTests/connected/index.html
- open report and see:
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don’t inherit from TestCase or lack @Test annotations).
- look at the logs on the emulator. see tombstone
JNI DETECTED ERROR IN APPLICATION:
JNI NewGlobalRef called with pending exception java.lang.ClassNotFoundException:
Didn't find class "android.support.test.services.shellexecutor.ShellMain" on path:...
Expected Results
Test should pass
Actual Results
Test process crashes
AndroidX Test and Android OS Versions
- Not on androidX yet
- Emulator running Android SDK 27
Link to a public git repo demonstrating the problem:
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Android Test Orchestrator not working with Android X
from looking at the above: It seems like it is trying to execute this command with android support version as opposed to the...
Read more >android test orchestrator no tests found, android test class not found ...
As Android Test Orchestrator runs each test in a separate instrumentation a crash would crash just that instrumentation and not affect the rest...
Read more >Virtual Device testing for Android step doesn't work properly ...
Hi, I am running android UI Tests with Espresso. I am using Android Test Orchestrator and have set clear app data between tests...
Read more >godot Godot Web Editor not using/allowing gles3 - Cplusplus
Even though the editor may say that is using GLES 3, all the objects and the editor itself still act as if it's...
Read more >Espresso 设置说明| Android 开发者
添加新的Android Tests 配置。 选择一个模块。 添加特定的插桩测试运行程序: androidx.test.runner.AndroidJUnitRunner; 运行新创建的配置 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tir38 How did you declare the dependency?
In my case I had it:
but it should be:
After I made this change it worked fine.
Note that testing does work correctly with AndroidX Orchestrator. Changing the following two lines fixes things.