I had this problem on a non jailbroken iphone 4s tried the above to no avail .
Basically if you've exhausted all the other fixes... changing the battery,removing firewall,antivirus,editing host file etc etc. Then check the last line of your itunes restore log if it says something like...'RamrodErrorr domain/3ea: update_gas_gauge: gasgauge_swupdate returned -1' ... Ifixit has the answer and more details here.....
http://www.ifixit.com/Answers/View/124735/Small+component+broken+from+the+logic+board .
In my case on a (very)close inspection it's a capacitor.. that's missing!?!.
Hope this helps someone as this info took me best part of a week to find!