I had the same problem with my one x. It was because I was using a different charger. Ensure you are using the stock charger and if the problem persists, try a different micro usb lead!
Sent from my Nexus 4 using xda app-developers app
Phone history from day one:
Sony CD5E > Nokia 3310 > Nokia 8310 > Sony Ericsson K800i > Sony Ericsson K850i > Sony Ericsson C902 > Blackberry Bold 9000 > iPhone 4 (16GB Black) > Nokia Lumia 800 (given it for free, never really used it...) > HTC One X (Black) > Google Nexus 4 16GB (best phone yet).