MacBook pro mid 2014 with High Sierra and APFS - Overallocation Detected on main device
I would have commented on Peku2455's answer, but I don't have 50 rep. So here is the solution, based on Peku's answer (which is missing the -o switch to fix overallocation)

In Terminal in Recovery Mode (press Command+R while booting, select Utilities -> Terminal):

diskutil unmountDisk /dev/disk0
fsck_apfs -oy /dev/disk0