My phone wasn't charging either. I tried the suggestions above, but none worked.
Then I noticed my phone battery was a bit loose, had a tiny gap, and was not connecting well with my phone.
So I pressed the battery terminals down to make sure it had a good contact with phone terminals and the phone suddenly turned on and started to charge.
Then I took a piece of paper, made it thick enough, to insert it in the gap to make sure the battery stayed tight, put the back cover back on and that's it it charged and worked just as before.