当前位置: 首页 > 知识库问答 >
问题:

Android Studio 3.6测试框架意外退出,orchestrator崩溃

谷梁德容
2023-03-14

我很难在Android Studio中运行仪器化测试。

当我尝试运行多个测试用例时,会出现“测试框架意外退出”:

...所有的测试都继续在模拟器中运行,但Android Studio没有得到结果。

...
03-17 11:38:59.236  1699  1719 W ActivityManager: Scheduling restart of crashed service androidx.test.orchestrator/.OrchestratorService in 1000ms
03-17 11:38:59.236  1699  1719 W ActivityManager: Crash of app androidx.test.orchestrator running instrumentation ComponentInfo{androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator}
03-17 11:38:59.236  1699  1721 W zygote  : kill(-8537, 9) failed: No such process
03-17 11:38:59.238  1699 13861 W Binder  : Outgoing transactions from this process must be FLAG_ONEWAY
03-17 11:38:59.238  1699 13861 W Binder  : java.lang.Throwable
03-17 11:38:59.238  1699 13861 W Binder  :  at android.os.BinderProxy.transact(Binder.java:752)
03-17 11:38:59.238  1699 13861 W Binder  :  at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:160)
03-17 11:38:59.238  1699 13861 W Binder  :  at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
03-17 11:38:59.281  1699  1721 W zygote  : kill(-8537, 9) failed: No such process
03-17 11:38:59.323  1699  1721 W zygote  : kill(-8537, 9) failed: No such process
03-17 11:38:59.353 13845 13845 W app_process: Unexpected CPU variant for X86 using defaults: x86
03-17 11:38:59.362  1699  1721 W zygote  : kill(-8537, 9) failed: No such process
03-17 11:38:59.385  1699  1741 W PackageManager: Code path for androidx.test.orchestrator changing from /data/app/androidx.test.orchestrator-fgDRlA7iNSNiyWm4dLj4hg== to /data/app/androidx.test.orchestrator-6QljegpCqjAHwDuS_O9G9Q==
03-17 11:38:59.385  1699  1741 W PackageManager: Resource path for androidx.test.orchestrator changing from /data/app/androidx.test.orchestrator-fgDRlA7iNSNiyWm4dLj4hg== to /data/app/androidx.test.orchestrator-6QljegpCqjAHwDuS_O9G9Q==
03-17 11:38:59.424 13845 13870 W MessageQueue: Handler (android.os.Handler) {9320712} sending message to a Handler on a dead thread
03-17 11:38:59.424 13845 13870 W MessageQueue: java.lang.IllegalStateException: Handler (android.os.Handler) {9320712} sending message to a Handler on a dead thread
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.Handler.enqueueMessage(Handler.java:662)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.Handler.sendMessageAtTime(Handler.java:631)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.Handler.sendMessageDelayed(Handler.java:601)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.Handler.post(Handler.java:357)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
03-17 11:38:59.424 13845 13870 W MessageQueue:  at android.os.Binder.execTransact(Binder.java:697)
03-17 11:38:59.436 13768 13850 W zygote  : Long monitor contention with owner firebase-iid-executor (13808) at void java.lang.AbstractStringBuilder.ensureCapacityInternal(int)(AbstractStringBuilder.java:124) waiters=0 in java.util.TimeZone java.util.TimeZone.getTimeZone(java.lang.String) for 114ms
03-17 11:38:59.519 13768 13768 W ResourceType: Failure getting entry for 0x7f0c0112 (t=11 e=274) (error -75)
03-17 11:38:59.520 13768 13768 W ResourceType: Failure getting entry for 0x7f0c0113 (t=11 e=275) (error -75)
03-17 11:38:59.608  1571  1809 E         : Couldn't opendir /data/app/vmdl185214765.tmp: No such file or directory
03-17 11:38:59.608  1571  1809 E installd: Failed to delete /data/app/vmdl185214765.tmp: No such file or directory
03-17 11:38:59.695  1699  1719 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:androidx.test.orchestrator flg=0x4000010 (has extras) } to com.google.android.gms/.games.chimera.GamesSystemBroadcastReceiverProxy
03-17 11:38:59.702  1699  1719 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:androidx.test.orchestrator flg=0x4000010 (has extras) } to com.google.android.gms/.photos.autobackup.PhotosAppUninstalledReceiver
...

我的测试依赖项:

    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-web:3.2.0'
    androidTestImplementation ('androidx.test.espresso:espresso-contrib:3.2.0') {
        exclude module: 'support-compat'
    }
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
    androidTestImplementation 'androidx.test:core:1.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'
    androidTestUtil 'androidx.test:orchestrator:1.2.0'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'

我发现很少有人提到“测试框架意外退出”和“此进程的传出事务必须是flag_oneway”来禁用Android Studio中的即时运行,但自从3.5没有即时运行以来,它被重命名以应用代码更改,我看不到任何关闭它的选项。

有什么想法可以继续下去吗?

共有1个答案

鲁龙野
2023-03-14

似乎是AS3.6的一个Bug。

根据Reddit中的这条线程:https://www.reddit.com/r/androiddev/comments/f9xsz2/anyon_else_having_issues_running_androidtest/

它将在3.6.2中得到修复。

 类似资料:
  • 测试启动后,结果是测试通过,但测试框架意外退出。如何解决? 试样 测试特性 输出 配置 http://maven.apache.org/xsd/maven-4.0.0.xsd"

  • 我正昂首阔步地在Intellij中运行一个简单的Cucumber脚本。在解决了所有依赖问题之后,现在当我运行场景时,我得到的错误是:测试框架意外退出 下午4点34分开始测试... 请帮我做这个。已经在这上面浪费了很多时间。

  • 我正在从Eclipse迁移到Intellij理念。当我在Intellij理念中运行测试时,我得到了图像中显示的错误,但在Eclipse中没有。测试在Eclipse中运行良好。请告诉我如何解决这个问题。 这就是我运行测试的方式。我得到的错误是:

  • 我如何使测试工作?

  • 我刚刚安装了MacOSX和Mavericks(10.9.2)。安装了JDK1.7.0_ 55。一切似乎都安装正确。我下载了EclipseKepler4.3.2并解压缩到我的应用程序文件夹。我再次检查了安装情况。启动应用程序时,我会收到以下错误消息: 我检查了我的控制台输出,并在Eclipse错误报告中得到以下内容: 异常类型:EXC _坏_访问(SIGSEGV)异常代码:KERN _ INVALI

  • 测试框架工具 Karma Intern NightWatch.js