Hi Folks,
I am NOT sure if my answer will be of any help. But, if it does, I am sure you it will have your day made wonderful.
I can sense how irritating it is to read USB notification that states “unable to charge while in the host mode”.
== The REAL problem is : ==
The USB charger that you are using does not support FAST CHARGING (anymore). Means, your charger is either '''physically damaged''' or '''not supported by the hardware''' that’s using specific version Android.
== What causes the issue ? : ==
When (factory or custom) Android was first installed on your device by device manufacturer & if the fast charging was supported by your Android hardware, the option that says “''enable fast charging''” was checked. Set to “''Yes''”. This means, the device will be charged efficiently only when Fast Charging USB Cable is connected to it. Otherwise, it (USB) will only connect to form a connection for Data transfer.
== Possible Solution(s) : ==
There are two possible solutions to this problem, & Solution 1 is highly recommended.
'''Solution 1 (Recommended) :''' Check your Fast Charging Cable is causing the same issue with other fast charging enabled devices. All high ended smartphones are usually fast charging enabled. By the way, if it’s causing same issue, go to local shops (with your device) ask for fast charging USB cable, test it & buy it if it’s able to charge your phone.
'''Solution 2 :''' Restart your Phone in recovery mode, using ''Power + Volume Up'' buttons or Power + Home + Volume Up buttons and uncheck “enable fast charging” from the list of options. It should allow your Non-Fast USB cable to still charge the phone (affects battery)
''Note : Please avoid solution 2, and try it on your own risk. ''
If it helps, please free to comment.