First, try a hard reset, to set a good reference point, using the instructions attached.
Then, detach and reattach the lens, clean the contacts on both lenses and camera body where the lens is mounted with an eraser. Be careful to not allow residue to drop into the camera body. Bad communication between the lens and the camera can also cause of this error.
Finally, the one most likely thing that even experienced photographers miss is that a single small spot or smudge on the lens can cause the problem that you are having. Carefully clean the lens and look for any scratches.
Please keep in mind that my diagnosis & solutions provided are directly dependent on the accuracy of your description of the problem. As with any "do it yourself" fixes, success is a "team effort", since I can't see or touch the camera, and relies on the customer's manual dexterity and ability to follow the instructions well. If the "do it yourself" approach doesn't work out for you and you need conventional repair, please let me know.
If you require additional information, please use the Reply to Expert Tab to contact me. Click the ratings only after our exchange is complete and you are satisfied.
If you are satisfied that my answer is accurate or solves your issue, please do not forget to rate my answer OK, Good or Excellent.