Error when Running appium server and appium inspector

Cannot invoke method android.app.UiAutomation androidx.test.uiautomator.UiDevice.getUiAutomation() on object androidx.test.uiautomator.UiDevice@e6f3d9d with parameters []

I get this error when running appium inspector. Any ideas?

Fixed -> I just needed to restart the device