Chosen Solution

My MacBook Pro 13, 2017 would not charge but would power up while plugged in. I replaced the battery but I’m still having the same issue. Before replacing the battery it would do nothing unless it was plugged in. Now I can get it to show low battery screen if its not plugged in. Also the battery emblem at the top now shows an X inside it before I login. Once I login the battery emblem at the top is no longer there.

Did you have the battery replaced by an Apple Authorized Technician or by yourself or a third-party repair center? The reason why there is an X inside the battery icon is that the MacBook Pro sees that it is a defective battery and cannot draw power to it, resulting in a power failure for the product.

Replaced it myself with a battery from ifixit.