Appium v1.20.2 error

Can anyone help on these, I am frequently getting this error

[debug] e[35m[UiAutomator2]e[39m Deleting UiAutomator2 session
[debug] e[35m[UiAutomator2]e[39m Deleting UiAutomator2 server session
[warn] e[35m[UiAutomator2]e[39m Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: ‘DELETE /’ cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
[debug] e[35m[Logcat]e[39m Stopping logcat capture
[debug] e[35m[Logcat]e[39m Logcat already stopped
[debug] e[35m[ADB]e[39m Removing forwarded port socket connection: 8200
[debug] e[35m[ADB]e[39m Running ‘C:\Users\schintaginjala\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 08RSA23123505 forward --remove tcp:8200’[warn] e[35m[UiAutomator2]e[39m Unable to remove system port forward: Error executing adbExec. Original error: ‘Command ‘C:\Users\schintaginjala\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 08RSA23123505 forward --remove tcp:8200’ exited with code 1’; Stderr: ‘adb.exe: error: listener ‘tcp:8200’ not found’; Code: ‘1’
[info] e[35m[UiAutomator2]e[39m Restoring hidden api policy to the device default configuration
[debug] e[35m[ADB]e[39m Running ‘C:\Users\schintaginjala\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 08RSA23123505 shell ‘settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy’’[debug] e[35m[HTTP]e[39m Request idempotency key: 7153c99f-518a-436a-a92c-7b6e1f5f3b6c
[info] e[35m[HTTP]e[39m e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m
[info] e[35m[HTTP]e[39m e[90m{“capabilities”:{“firstMatch”:[{}],“alwaysMatch”:{“appium:udid”:“08RSA23123505”,“platformName”:“Android”,“appium:adbExecTimeout”:300000,“appium:automationName”:“UiAutomator2”}},“sessionId”:“2c918035-8c83-4160-ab6e-a7cc8b656866”}e[39m
[debug] e[35m[W3C]e[39m Calling AppiumDriver.createSession() with args: [null,null,{“firstMatch”:[{}],“alwaysMatch”:{“appium:udid”:“08RSA23123505”,“platformName”:“Android”,“appium:adbExecTimeout”:300000,“appium:automationName”:“UiAutomator2”}}]
[debug] e[35m[BaseDriver]e[39m Event ‘newSessionRequested’ logged at 1709290338740 (16:22:18 GMT+0530 (India Standard Time))
[info] e[35m[Appium]e[39m Appium v1.20.2 creating new AndroidUiautomator2Driver (v1.61.2) session
[debug] e[35m[Appium]e[39m There are no active sessions for cleanup
[info] e[35m[Appium]e[39m Applying relaxed security to ‘AndroidUiautomator2Driver’ as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[debug] e[35m[BaseDriver]e[39m Creating session with W3C capabilities: {
[debug] e[35m[BaseDriver]e[39m “alwaysMatch”: {
[debug] e[35m[BaseDriver]e[39m “platformName”: “Android”,
[debug] e[35m[BaseDriver]e[39m “appium:udid”: “08RSA23123505”,
[debug] e[35m[BaseDriver]e[39m “appium:adbExecTimeout”: 300000,
[debug] e[35m[BaseDriver]e[39m “appium:automationName”: “UiAutomator2”
[debug] e[35m[BaseDriver]e[39m },
[debug] e[35m[BaseDriver]e[39m “firstMatch”: [
[debug] e[35m[BaseDriver]e[39m {}
[debug] e[35m[BaseDriver]e[39m ]
[debug] e[35m[BaseDriver]e[39m }

Probably because it’s over 2 years out of support. Consider upgrading to Appium 2:

No I am using 2.5.1

appium -v
2.5.1

Please post the log from 2.5.1, not just the version check. The log you posted with the error you are seeing states plainly that it’s v1.20.2. Perhaps there is a mistake that I can help you clear up?

Hi in my script I am using both appium and selenium servers while starting session from appium I am getting this error
These are the appium logs:-
Welcome to Appium v2.5.1
[Appium] Non-default server args:
[Appium] {
[Appium] port: 4724
[Appium] }
[Appium] The autodetected Appium home path: C:\Users\schintaginjala.appium
[Appium] Attempting to load driver uiautomator2…
[Appium] Attempting to load driver xcuitest…
[Appium] Requiring driver at C:\Users\schintaginjala.appium\node_modules\appium-uiautomator2-driver\build\index.js
[Appium] Requiring driver at C:\Users\schintaginjala.appium\node_modules\appium-xcuitest-driver\build\index.js
[Appium] AndroidUiautomator2Driver has been successfully loaded in 1.969s
[Appium] XCUITestDriver has been successfully loaded in 1.969s
[Appium] Appium REST http interface listener started on http://0.0.0.0:4724
[Appium] You can provide the following URLs in your client code to connect to this server:
[Appium] http://172.18.16.1:4724/
[Appium] http://192.168.220.93:4724/
[Appium] http://127.0.0.1:4724/ (only accessible from the same host)
[Appium] Available drivers:
[Appium] - [email protected] (automationName ‘UiAutomator2’)
[Appium] - [email protected] (automationName ‘XCUITest’)
[Appium] Available plugins:
[Appium] - [email protected]
[Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate
[HTTP] Request idempotency key: 8ec1e1ab-8371-464c-b748-ed6acbb3231f
[HTTP] → POST /wd/hub/session
[HTTP] {“capabilities”:{“firstMatch”:[{}],“alwaysMatch”:{“appium:udid”:“08RSA23123505”,“platformName”:“Android”,“appium:adbExecTimeout”:300000,“appium:automationName”:“UiAutomator2”}}}
[HTTP] No route found for /wd/hub/session
[HTTP] ← POST /wd/hub/session 404 19 ms - 211

These are the capabilities I have used: -
desired = {
“udid”: pre_required_details.device_id,
“platformName”: “Android”,
“adbExecTimeout”: 300000,
“automationName” : “UiAutomator2”
}
option = AppiumOptions().load_capabilities(desired)
Appium_driver = appium_webdriver.Remote(command_executor=f"http://localhost:4724/wd/hub", options=option)

For this error please refer to the link above that I have posted regarding upgrading to Appium 2. Please read the whole thing, but pay close attention to the section entitled, “Breaking Changes”.