无法连接到 android.support.test.orchestrator.OrchestratorService

Posted

技术标签:

【中文标题】无法连接到 android.support.test.orchestrator.OrchestratorService【英文标题】:Cannot connect to android.support.test.orchestrator.OrchestratorService 【发布时间】:2019-06-28 00:23:27 【问题描述】:

无法使用 android orchestrator 运行检测测试, 我已关注developer doc 并进行了相同的更改,但它不起作用。

已附上屏幕截图和日志。 任何帮助将不胜感激提前感谢

Logcat:

E/AndroidRuntime: 致命异常: main 进程:com.example.ctpl.myinstrumentationtest,PID:6608 java.lang.RuntimeException:在 ComponentInfocom.example.ctpl.myinstrumentationtest.test/android.support.test.runner.AndroidJUnitRunner 的 onCreate() 中引发异常:java.lang.RuntimeException:无法连接到 android.support.test .orchestrator.OrchestratorService 在 android.app.ActivityThread.handleBindApplication(ActivityThread.java:5868) 在 android.app.ActivityThread.access$1100(ActivityThread.java:199) 在 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 在 android.os.Handler.dispatchMessage(Handler.java:106) 在 android.os.Looper.loop(Looper.java:193) 在 android.app.ActivityThread.main(ActivityThread.java:6669) 在 java.lang.reflect.Method.invoke(本机方法) 在 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 原因:java.lang.RuntimeException: 在 android.support.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.connect(OrchestratedInstrumentationListener.java:87) 在 android.support.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:303) 在 android.app.ActivityThread.handleBindApplication(ActivityThread.java:5863) 在 android.app.ActivityThread.access$1100(ActivityThread.java:199) 在 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) 在 android.os.Handler.dispatchMessage(Handler.java:106) 在 android.os.Looper.loop(Looper.java:193) 在 android.app.ActivityThread.main(ActivityThread.java:6669) 在 java.lang.reflect.Method.invoke(本机方法) 在 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

    列表项

【问题讨论】:

您处理并解决了吗? 【参考方案1】:

我遇到了同样的问题,但使用的是 androidx Orchestrator。我遇到了同样的异常,但包不同:Caused by: java.lang.RuntimeException: Cannot connect to androidx.test.orchestrator.OrchestratorService

我在this github 线程中找到了可能根本原因的描述。有一个有趣的讨论,但似乎还没有通用的解决方案。

对我来说,问题是由将目标 sdk 设置为 30 并在 android 30 模拟器上启动应用程序引起的。因此,使用 api

【讨论】:

问题今天仍然存在,但前提是您出于某种原因从命令行手动安装了 test-orchestrator 和 test-services。如果你从 android studio 做任何事情,它也可以在 Android 11 上与 v1.4.0 的 test-orchestrator 一起使用。 已解决:如果您在从命令行运行时遇到此问题,请按照此答案中的说明进行操作(仅适用于 Android 11 及更高版本):***.com/a/67466181/507339

以上是关于无法连接到 android.support.test.orchestrator.OrchestratorService的主要内容,如果未能解决你的问题,请参考以下文章

无法连接到虚拟机怎么解决?怎么解决?

无法使用php连接错误连接到mysql:无法连接到'localhost'(10061)上的MySQL服务器[重复]

MySQL Workbench 无法连接到我的 RDS 数据库:无法连接到 localhost

Django docker 容器无法连接到 mysql 容器,出现错误“无法连接到 'db' (111) 上的 MySQL 服务器”)

GitHub - 无法连接到 github 443 windows/ 无法连接到 gitHub - 没有错误

Windows 10 上的 RabbitMQ - 无法连接到 epmd:地址(无法连接到主机/端口)