Hello , this is how is this issue today and worked for me -
Source- [https://goo.gl/NNLakw|5 ways to fix accessory may not be supported error]
1- clean the charging port of your phone carefully using brush Or toothpick
2- try branded cable instead of local cable
3- dismiss the error while charging and wait for sometime
at last you can also make sure your charger contact is not broken Or Mismatched
Use a pin to align the charging metals connectors
See if this seems to be helpful