M.M.
This happened to me until I learned how to use my pump! Does it have a lever by the hole the air comes out of? If so, attach the pump to the air valve on the tire, then lift the lever so it is sticking horizontally. On my pump at least, this locks the pump to the tire and allows the air to flow through. Then when you're done pumping, lower the lever back to the original position and remove the pump. Hope that helps!!
ETA: I was doing the EXACT same thing!!!! Totally backwards!!