Charging Not Supported With This Accessory?

Recently I've been charging my iPhone 4 fine, but just now it has said 'charging not supported with this accessory' does anyone know how to fix this? Is it a problem with the software or with the charger? Also my brother used the same charger before me and he has the ios7 whereas I still have ios6, could this have an effect or not?

One suggestion don't upgrade to ios7 is slow on iphone 4.

No is not problem about software and maybe yes but first try, try other USB cable, or charger. And restart your iphone holding both button home and power till apple logo apear then release. And also try turn off iphone and put charger.

Try this method
1. Plug charger into phone
2. When the error message comes up click dismiss and hold the button down
3. With the button held down unplug your phone
4. With your finger still held against the touch screen, plug the charger back in.

Lots of info on this on the internet: http://www.gatorspit.com/tips/iphone-wont-charge.html