I tried everything, but in the end I found that commenting out this code made it start working and I was able to get touch inputs:
Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked;