4

运行 Android Instrumented Tests,gradle 任务:app:connectedDebugAndroidTest现在在成功测试运行后打印红色警告:

Feb 12, 2022 11:53:02 PM com.android.tools.utp.plugins.host.additionaltestoutput.AndroidAdditionalTestOutputPlugin deviceShellAndCheckSuccess
WARNING: Shell command failed (1): ls "/sdcard/Android/media/<APP_NAME>/additional_test_output"
ls: /sdcard/Android/media/<APP_NAME>/additional_test_output: No such file or directory

Feb 12, 2022 11:53:02 PM com.android.tools.utp.plugins.host.additionaltestoutput.AndroidAdditionalTestOutputPlugin afterAll
WARNING: Failed to retrieve additional test outputs from device.
com.android.ddmlib.SyncException: Remote object doesn't exist!
    at com.android.ddmlib.SyncService.pullFile(SyncService.java:341)
    ...

确实模拟器没有这样的文件,但是之前没有预料到测试会创建它。

:有没有办法解决这个警告?它是一个测试编排器错误吗?(我不打算破解测试来创建一个空文件。)

环境: Android Studio on MBP, com.android.tools.build:gradle:7.1.1, androidx.test:orchestrator:1.4.1, 用于 API 级别 26 - 32 的 Android 模拟器,有些有 Google API,有些没有 Google API;也在 API 级别 31 的 Pixel 3 设备上。

在 API 级别 21 - 25 的模拟器上,它会打印(而不是刺眼的红色文本):

additionalTestOutput is not supported on this device running API level 25 because the additional test output directory could not be found
4

1 回答 1

0

降级 Gradle 对我有用

于 2022-03-02T13:06:16.690 回答