I found how to fix it.
Hello This is for the wall charger I haven’t tested other like usb etc but I tested it on wall charger and it worked.
When I plugged in my wall charger to iphone 3gs firmware 4.2.1 baseband 6.15.00 it would say Charging is not supported with this accessory?Well I found a solution for me.
This Might work for you, I don’t guarantee 100% but it worked for me.
@Try doing this it worked for me@
1-Plug in your charger.
2-When the message pops up “Charging is not supported with this accessory?” press dismiss and hold it.
3- while holding dismiss, unplug the charger from the iphone not the wall , and put it back in.
Well done it should work now.
Do a clean up.
1-try blowing in both end and the iphone charging whole or how your call it.
2- if you have the wall charger the one were you have to connect usb to it and plug to wall try taking a tooth brash add perfume on it not a lot and brush the wall charger.
Thanks, if the first method worked and if you gonna like it, please comment and click liked