Charging is not supported with this accesory? IPHONE 4

My iphone 4 usually charges fine, but recently whenever I plug it in to charge it displays the message, "Charging is not supported with this accesory." I'm not sure why this happens. Sometimes if i unplug the cord and plug it back it in it will charge for about 10 minutes and then display that message again. The charger and cable are still relatively new; I've only had them for about a month along with the iPhone. Can anybody help me find a way to fix this problem!

Make sure the cable is from Apple. It might be that, or your iphone is glitched up a little. If I were you, i would create a backup of the iphone on your computer, and reset it, then restore it to the backup file.