Appium throws 500 error for element not found, hence following tests also fail


When I am running a test and an element is not found it throws a 500 error in Appium as shown below :
[HTTP] <-- POST /wd/hub/session 500 5 ms - 193

Below is the error message on my terminal :
WebDriverException: Message: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement ‘get driverData’?

Hence the subsequent tests also are failing as Appium does not start a new session.
Could anyone help me in solving this issue.