If an X appears on your Mac battery icon
If the battery icon in the menu bar contains an X, either your Mac does not recognise the battery or the battery is not properly installed in your portable Mac.
If a battery is fully charged, but you still see an X: Your Mac may not recognise the battery. After you plug in your Mac and let the battery charge for five minutes, the battery should be recognised.
Your battery can become fully drained if you use your Mac unplugged until it puts itself to sleep or if you leave it in sleep mode for an extended period.
If your computer has an accessible battery: If you can access the battery, remove it, then reinstall it. Refer to the manual that came with your Mac for more information about properly installing the battery.
If the battery icon in the menu bar still has an X in it, your Mac may need to be serviced. See Find how to service or repair your Mac.