Appium server stops logging while trying to find a element

Im trying to tap on an element using this code here -

Rectangle rect = driver.findElement(By.xpath("//android.widget.FrameLayout[@index='0']")).getRect(); TouchAction touchAction=new TouchAction(driver); touchAction.tap(PointOption.point((int) 33,(int) 192)).perform();

My server logs smoothly until I want it to execute this command. The server stops logging for a good 15 minutes and gives me a - org.openqa.selenium.WebDriverException: Connection refused: connect

My appium logs are as follows

[HTTP] --> POST /wd/hub/session/91277598-d737-423b-8402-5b19a7a71e19/element [HTTP] {"using":"xpath","value":"//android.widget.FrameLayout[@index='0']"} [W3C (91277598)] Calling AppiumDriver.findElement() with args: ["xpath","//android.widget.FrameLayout[@index='0']","91277598-d737-423b-8402-5b19a7a71e19"] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [BaseDriver] Waiting up to 0 ms for condition [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.FrameLayout[@index='0']","context":"","multiple":false}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.FrameLayout[@index='0']","context":"","multiple":false}} [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.FrameLayout[@index='0']' using 'XPATH' with the contextId: '' multiple: false

Its been like this for the past 10 minutes

Can anyone help me out? I’ve asked the same question before but received no solutions.