I've lost my IMEI (well, it's become 0) I've managed to lose my IMEI on my Moto X 2013/1st Gen/XT1052. I've tried the following things:


flashed stock ROM
removed SIM, flashed stock ROM, boot, power off, insert SIM
erased modemst1 and modemst2 partitions
fastboot oem writeimei (this replied "Restricted oem command")
restoring PDS partition from a TWRP backup from when it was working fine.


I can read the IMEI (getvar, or via barcodes) in fastboot, so it's still there somewhere, but the android system can't seem to access it. Any suggestions would be appreciated
I had the same issue upgrading from Android 4.4.4 to Android 5.0.2 on my Samsung Galaxy SM-A300FU.

The problem was, that I have rebooted the mobile into download mode and did not power off the device. Odin has successfully flashed the modem partition, but it was not really accessible. I had flashed a new platform build, but the baseband version was the same like before flashing.

Maybe there is a similar problem on your Moto. Try to shutdown your device, wait 10-20 seconds to get sure all caps has been discharged and try again to flash your modem partition.