Appium Android UiAutomation未连接!附录1.17.1-1

Appium Android UiAutomation未连接!附录1.17.1-1,appium,android-testing,android-uiautomator,Appium,Android Testing,Android Uiautomator,我们正在尝试使用以下功能应用会话 [debug] [35m[BaseDriver] [39m "deviceName": "8C4Y14QBGA", [debug] [35m[BaseDriver] [39m "newCommandTimeout": "1800", [debug] [35m[BaseDriver] [39m "automationName": "UiAutomator2", [debug] [35m[BaseDriver] [39m "app": "/process/uploa

我们正在尝试使用以下功能应用会话

[debug] [35m[BaseDriver] [39m "deviceName": "8C4Y14QBGA",
[debug] [35m[BaseDriver] [39m "newCommandTimeout": "1800",
[debug] [35m[BaseDriver] [39m "automationName": "UiAutomator2",
[debug] [35m[BaseDriver] [39m "app": "/process/uploads/20200609131058_nqx3Q.apk",
[debug] [35m[BaseDriver] [39m "platformName": "android",
[debug] [35m[BaseDriver] [39m "platformVersion": "9",
[debug] [35m[BaseDriver] [39m "connectHardwareKeyboard": "true"
我们正在使用Java Appium客户端库创建具有上述功能的会话,在截图“UiAutomation not connected!”时出现错误

这是Appium错误日志

[debug] [35m[MJSONWP (3128a38e)][39m Calling AppiumDriver.getScreenshot() with args: ["3128a38e-d465-4c28-bba5-f9977abd4150"]
[debug] [35m[WD Proxy][39m Matched '/screenshot' to command name 'getScreenshot'
[debug] [35m[WD Proxy][39m Proxying [GET /screenshot] to [GET http://127.0.0.1:8200/wd/hub/session/be4490f0-7be9-48cd-bcae-6a32ed9359c0/screenshot] with no body[35m[WD Proxy][39m Got response with status 500: {"sessionId":"be4490f0-7be9-48cd-bcae-6a32ed9359c0","value":{"error":"unknown error","message":"java.lang.IllegalStateException: UiAutomation not connected!","stacktrace":"java.lang.IllegalStateException: UiAutomation not connected!\n\tat android.app.UiAutomation.throwIfNotConnectedLocked(UiAutomation.java:1112)\n\tat android.app.UiAutomation.takeScreenshot(UiAutomation.java:709)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeDeviceScreenshot(Unknown Source:169)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeScreenshot(Unknown Source:7)\n\tat io.appium.uiautomator2.utils.ScreenshotHelper.takeScreenshot(Unknown Source:1)\n\tat io.appium.uiautomator2.handler.CaptureScreenshot.safeHandle(Unknown Source:11)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(Unknown Source:0)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(Unknown Source:23)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(Unknown Source:57)\n\tat io.appium.uiautomator2.ht...
[debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError
[debug] [35m[MJSONWP (3128a38e)][39m Encountered internal error running command: An unknown server-side error occurred while processing the command. Original error: java.lang.IllegalStateException: UiAutomation not connected!
[debug] [35m[MJSONWP (3128a38e)][39m java.lang.IllegalStateException: UiAutomation not connected!
  • 如果出于安全目的为您的应用启用了安全标志,Appium将不会截屏。请开发人员为您提供一个设置为禁用的应用程序
  • 此外,为了消除最新的appium版本1.17.1-1出现问题的可能性,请尝试使用appium版本1.16.0截图并分享您的结果
  • 如果出于安全目的为您的应用启用了安全标志,Appium将不会截屏。请开发人员为您提供一个设置为禁用的应用程序
  • 此外,为了消除最新的appium版本1.17.1-1出现问题的可能性,请尝试使用appium版本1.16.0截图并分享您的结果

  • 我们在Appium release repo上找不到Appium 1.16.0.dmg文件。@Mobi_Dev使用以下命令安装特定版本的Appium CLI-
    npm-install-gappium@1.16.0
    但是,在此之前,如果尚未安装节点,则还必须安装节点。请在线阅读一些文章以完成此操作,例如-我们在Appium release repo上找不到Appium 1.16.0.dmg文件。@Mobi_Dev使用以下内容安装特定版本的Appium CLI-
    npm-install-gappium@1.16.0
    但是,在此之前,如果尚未安装节点,则还必须安装节点。例如,为了完成这项工作,请在线阅读一些文章-