The F-- error message is indicating the camera and lens are not communicating. Either the lens is not designed with electronic contacts, or maybe the lens is not connected fully and clicked in to place. Make sure if the lens is a CPU lens, that it is completely connected onto the cameras bayonet lens mount. Also, be careful not to press the lens release button as this may cause the error. Rotate the lens to lock in place.
You will hear a "click" when the lens is locked in place.
If the problem only occurs occasionally and intermittently, the lens pins and/ or camera contacts may be dirty. Inspect the lens contacts for grease or dirt and wipe them clean with a lint free cloth.
If setting the aperture at maximum aperture isn't doing the trick, then check the electrical contacts on the lens and on the camera mount to be sure they are clean and the spring-loaded contacts on the lens are all functioning properly.
If you have an older lens that is not CPU compatible, you will only be able to use the lens in Manual shooting mode.