我想用 appium 跑安卓所有系统版本的自动化,抛开 4.1 以下的 selendroid 模式不谈,我连用 4.2 的系统也有问题,appium 官方不是说支持 sdk>=17 的吗?以下是报错 log,感觉是 appium 的 bug 啊,有同学知道如何解决吗?

> info: --> POST /wd/hub/session/90fe7172-7ac1-4f8b-8d6e-d7bf4dd9ab0b/elements {"using":"class name","value":"android.widget.RadioButton"}
> info: [debug] Waiting up to 10000ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"class name","selector":"android.widget.RadioButton","context":"","multiple":true}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"class name","selector":"android.widget.RadioButton","context":"","multiple":true}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: find
> info: [debug] [BOOTSTRAP] [debug] Finding android.widget.RadioButton using CLASS_NAME with the contextId:  multiple: true
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.RadioButton]
> info: [debug] [BOOTSTRAP] [debug] getElements selector:UiSelector[CLASS=android.widget.RadioButton]
> info: [debug] [BOOTSTRAP] [debug] Element[] is null: (0)
> info: [debug] [BOOTSTRAP] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.RadioButton, INSTANCE=0]
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Error in testRunServer:
> info: [debug] [UIAUTOMATOR STDOUT] java.lang.NoClassDefFoundError: com.android.uiautomator.core.Configurator
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElement.<init>(AndroidElement.java:26)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElementsHash.addElement(AndroidElementsHash.java:47)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElementsHash.getElements(AndroidElementsHash.java:155)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.Find.fetchElements(Find.java:167)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.Find.execute(Find.java:104)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:64)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:168)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:89)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:133)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:16)
> info: [debug] [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:144)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:87)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:90)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
> info: [debug] [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stack=java.lang.NoClassDefFoundError: com.android.uiautomator.core.Configurator
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElement.<init>(AndroidElement.java:26)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElementsHash.addElement(AndroidElementsHash.java:47)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidElementsHash.getElements(AndroidElementsHash.java:155)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.Find.fetchElements(Find.java:167)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.Find.execute(Find.java:104)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:64)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:168)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:89)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:133)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:16)
> info: [debug] [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:144)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:87)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:90)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
> info: [debug] [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.E
> info: [debug] [UIAUTOMATOR STDOUT] Time: 16.652
> info: [debug] [UIAUTOMATOR STDOUT] FAILURES!!!
> info: [debug] [UIAUTOMATOR STDOUT] Tests run: 1,  Failures: 0,  Errors: 1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator exited
> info: [debug] executing cmd: E:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe -s 0123456789ABCDEF shell "echo 'ping'"
> info: [debug] Attempting to uninstall app
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Cleaning up android objects
> info: [debug] Waited for 441ms so far
> info: [debug] Cleaning up appium session
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"class name","selector":"android.widget.RadioButton","context":"","multiple":true}]
> info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Tried to send command to non-existent Android device, maybe it shut down?"},"sessionId":null}
> info: <-- POST /wd/hub/session/90fe7172-7ac1-4f8b-8d6e-d7bf4dd9ab0b/elements 500 956.105 ms - 208 
> info: --> DELETE /wd/hub/session/90fe7172-7ac1-4f8b-8d6e-d7bf4dd9ab0b {}
> info: <-- DELETE /wd/hub/session/90fe7172-7ac1-4f8b-8d6e-d7bf4dd9ab0b 404 3.373 ms - 40 
> Update not available
> Killed Node Server.
> Node Server Process Ended


↙↙↙阅读原文可查看相关链接,并与作者交流