Sometimes, it happens when the autofocus is disabled in the settings. Ensure that single, continuous, and manual autofocus modes are active. Also, inspect the lens’s attachment and see if the contacts need cleaning. If there is a firmware update for the camera, install it.