My MacBook Air does not charge sometimes. It shows a different battery icon and the battery does not charge. Previously I used to get rid of this by opening battery settings, upon opening the battery settings my Mac would charge smoothly again. But now this solution works no more and my Mac stops charging mysteriously. I think this is a software issue as I ran Mac Diagnostic and it showed me no hardware issues found.
I am running macOS Mojave 10.14.