Hi I had this problem with my phone but now I have figured out how to fix it. The thermistor ( which is located in the charging port) is faulty and reads a temperature to high or low hence then you can't charge the battery . There are two possible fixes to this problem
1. Replace charging part...