SDK中的错误:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "C:\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe -s ce0616068209b10805 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 26.70 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-1M92PA5', ip: '10.250.2.20', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:156)
at Appium.AppiumSetupPage.setUp(AppiumSetupPage.java:43)
at Appium.C8_Java.main(C8_Java.java:10)
Appium Server出错:
info:[debug]响应客户并出现错误:{&#34; status&#34;:33,&#34; value&#34;:{&#34; message&#34;:&#34; A无法创建新会话。 (原始错误:命令失败:C:\ WINDOWS \ system32 \ cmd.exe / s / c \&#34; C:\ android-sdk_r24.4.1-windows \ android-sdk-windows \ platform-tools \ adb.exe -s ce0616068209b10805安装\&#34; C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \&#34; \&#34; \ n无法安装C:\程序文件(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试在不先卸载的情况下重新安装io.appium.settings。] \ r \ n)&#34; &#34;杀死&#34;:假,&#34;代码&#34;:1,&#34;信号&#34;:空,&#34; CMD&#34;:&#34; C:\ WINDOWS \ system32 \ cmd.exe / s / c \&#34; C:\ android-sdk_r24.4.1-windows \ android-sdk-windows \ platform-tools \ adb.exe -s ce0616068209b10805 install \&#34; C :\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \&#34; \&#34;&#34;,&#34; origValue&#34;:&#34 ;命令失败:C:\ WINDOWS \ system32 \ cmd.exe / s / c \&#34; C:\ android-sdk_r24.4.1-windows \ android-sdk-windows \ platform- tools \ adb.exe -s ce0616068209b10805 install \&#34; C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \&#34; \&#34; \ nFailed安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试在不先卸载的情况下重新安装io.appium.settings。] \ r \ n&n #34;}&#34;的sessionId&#34;:空} info:&lt; - POST / wd / hub / session 500 26099.816 ms - 1420
答案 0 :(得分:0)
这是Android N(Android 7.0)的已知问题
您需要重新安装服务器(使用--no-shrinkwrap标志)或进入Appium安装并运行以下npm install命令。 npm install appium-adb@2.6.13 --no-shrinkwrap