Iphone 4 says charging not supported accessory?

Ahh what's happening, first it came up with this and kept flickering on and off charging and now it won't charge at all… What can i do to fix it?

Use original apple charger or dock

This happens with my cords all the time, it could be worn out. Try bending it different ways, the laying the iPhone down so it's pressures the cord down. I'm doing this with my phone, I usually wait till it's not working to buy a replacement. If that doesn't work, just go buy a new one: p

Sometimes just unplugging it and plugging back in works… Happens to me sometimes probably because I use a generic cable. If it continues I guess you should switch out the cord…