gradle 如何修复:任务“:app:connectedDebugAndroidTest”执行失败?

8xiog9wr  于 2023-01-17  发布在  Android
关注(0)|答案(1)|浏览(418)

我已经在模拟器上运行了一段时间的测试成功的应用程序,我目前正在工作,突然他们不再运行了。我已经尝试了2个不同的模拟器,我还没有尝试在一个真实的的设备。我还试图卸载应用程序从模拟器。
当前应用程序上的所有仪器测试都会发生这种情况。
以下是尝试运行测试时的堆栈跟踪:

> Task :app:connectedDebugAndroidTest
Device provider <com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceProvider> failed trying to provide device controller.
Android device (emulator-5554) is not found.
com.google.testing.platform.core.device.DeviceProviderException: ErrorName: UNDETERMINED
NameSpace: com.google.testing.platform
ErrorCode: 3999
Message: Android device (emulator-5554) is not found.
    at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceProvider.provideDevice(DdmlibAndroidDeviceProvider.kt:116)
    at com.google.testing.platform.executor.DeviceProviderProxy$provideDevice$2.invoke(DeviceProviderProxy.kt:118)
    at com.google.testing.platform.executor.DeviceProviderProxy$provideDevice$2.invoke(DeviceProviderProxy.kt:117)
    at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)
    at com.google.testing.platform.core.telemetry.TelemetryKt.recordEvent(Telemetry.kt:66)
    at com.google.testing.platform.executor.DeviceProviderProxy.provideDevice(DeviceProviderProxy.kt:114)
    at com.google.testing.platform.executor.SingleDeviceExecutor$execute$deviceController$1.invoke(SingleDeviceExecutor.kt:68)
    at com.google.testing.platform.executor.SingleDeviceExecutor$execute$deviceController$1.invoke(SingleDeviceExecutor.kt:68)
    at com.google.testing.platform.executor.SingleDeviceExecutor.runUnlessCancelled(SingleDeviceExecutor.kt:105)
    at com.google.testing.platform.executor.SingleDeviceExecutor.execute(SingleDeviceExecutor.kt:68)
    at com.google.testing.platform.RunnerImpl.run(RunnerImpl.kt:108)
    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4.invoke(NonInteractiveServerStrategy.kt:80)
    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy$run$4.invoke(NonInteractiveServerStrategy.kt:79)
    at com.google.testing.platform.core.telemetry.common.noop.NoopDiagnosticsScope.recordEvent(NoopDiagnosticsScope.kt:35)
    at com.google.testing.platform.core.telemetry.TelemetryKt.recordEvent(Telemetry.kt:66)
    at com.google.testing.platform.server.strategy.NonInteractiveServerStrategy.run(NonInteractiveServerStrategy.kt:79)
    at com.google.testing.platform.main.MainKt$main$4.invokeSuspend(Main.kt:67)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at com.google.testing.platform.main.MainKt.main(Main.kt:66)
    at com.google.testing.platform.main.MainKt.main$default(Main.kt:34)
    at com.google.testing.platform.main.MainKt.main(Main.kt)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.google.testing.platform.launcher.Launcher.main(Launcher.java:149)
yyyllmsg

yyyllmsg1#

我在使用Linux x86 - 64的platform-tools 33.0.3时也遇到过同样的问题,相同的版本在macOS M1上运行良好。在我尝试使用版本32.0.0后,它工作正常。您可以下载它here

相关问题