[Moto X4 Questions & Answers] William Dias:
I bricked my Moto X4 trying to install a Android One version (here in Brazil the moto X4 is sold with a Motorola version) and now I cannot do anything. I'm trying to unlock bootloader, it shows a error:

(bootloader) Check 'OEM unlocking' in Android Settings > Developer
(bootloader) Options

If I try to flash the stock rom, shows another error:

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot devices
0041718578 fastboot

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot getvar max-sparse-size
max-sparse-size: 268435456
Finished. Total time: 0.004s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot oem fb_mode_set
OKAY [ 0.012s]
Finished. Total time: 0.013s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash partition gpt.bin
Sending 'partition' (37 KB) OKAY [ 0.008s]
Writing 'partition' (bootloader) Validating 'gpt.default.xml'
(bootloader) Committing 'gpt.default.xml'
(bootloader) - flashing 'gpt_main0.bin' to 'partition:0'
OKAY [ 0.139s]
Finished. Total time: 0.179s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash bootloader bootloader.img
Sending 'bootloader' (9520 KB) OKAY [ 0.359s]
Writing 'bootloader' (bootloader) Validating 'bootloader.default.xml'
(bootloader) Committing 'bootloader.default.xml'
(bootloader) - flashing 'xbl.elf' to 'xbl'
(bootloader) - flashing 'prov64.mbn' to 'prov'
(bootloader) - flashing 'cmnlib.mbn' to 'cmnlib'
(bootloader) - flashing 'cmnlib64.mbn' to 'cmnlib64'
(bootloader) - flashing 'abl.elf' to 'abl'
(bootloader) - flashing 'keymaster.mbn' to 'keymaster'
(bootloader) - flashing 'storsec.mbn' to 'storsec'
(bootloader) - flashing 'rpm.mbn' to 'rpm'
(bootloader) - flashing 'pmic.elf' to 'pmic'
(bootloader) - flashing 'hyp.mbn' to 'hyp'
(bootloader) - flashing 'tz.mbn' to 'tz'
(bootloader) - flashing 'devcfg.mbn' to 'devcfg'
OKAY [ 0.298s]
Finished. Total time: 0.665s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash boot boot.img
Sending 'boot__a' (19857 KB) OKAY [ 0.760s]
Writing 'boot__a' (bootloader) Invalid partition name boot__a
FAILED (remote: '')
Finished. Total time: 0.779s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash modem NON-HLOS.bin
Sending 'modem__a' (95999 KB) OKAY [ 4.523s]
Writing 'modem__a' (bootloader) Invalid partition name modem__a
FAILED (remote: '')
Finished. Total time: 4.537s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash fsg fsg.mbn
Sending 'fsg__a' (5508 KB) OKAY [ 0.202s]
Writing 'fsg__a' (bootloader) Invalid partition name fsg__a
FAILED (remote: '')
Finished. Total time: 0.216s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase modemst1
Erasing 'modemst1' OKAY [ 0.012s]
Finished. Total time: 0.014s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase modemst2
Erasing 'modemst2' OKAY [ 0.009s]
Finished. Total time: 0.011s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash bluetooth BTFM.bin
Sending 'bluetooth__a' (4540 KB) OKAY [ 0.174s]
Writing 'bluetooth__a' (bootloader) Invalid partition name bluetooth__a
FAILED (remote: '')
Finished. Total time: 0.192s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash dsp dspso.bin
Sending 'dsp__a' (16384 KB) OKAY [ 0.621s]
Writing 'dsp__a' (bootloader) Invalid partition name dsp__a
FAILED (remote: '')
Finished. Total time: 0.641s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash logo logo.bin
Sending 'logo__a' (2153 KB) OKAY [ 0.085s]
Writing 'logo__a' (bootloader) Invalid partition name logo__a
FAILED (remote: '')
Finished. Total time: 0.105s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.0
Sending 'system__a' (516148 KB) OKAY [ 23.305s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 23.316s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.1
Sending 'system__a' (523332 KB) OKAY [ 21.351s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.362s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.2
Sending 'system__a' (519951 KB) OKAY [ 21.254s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.264s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.3
Sending 'system__a' (523343 KB) OKAY [ 21.381s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.391s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.4
Sending 'system__a' (524220 KB) OKAY [ 21.330s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.341s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.5
Sending 'system__a' (522975 KB) OKAY [ 21.418s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.427s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.6
Sending 'system__a' (517901 KB) OKAY [ 21.188s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 21.199s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system system.img_sparsechunk.7
Sending 'system__a' (171782 KB) OKAY [ 6.999s]
Writing 'system__a' (bootloader) Invalid partition name system__a
FAILED (remote: '')
Finished. Total time: 7.012s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash system_b system_other.img
Sending 'system_b' (134369 KB) OKAY [ 5.463s]
Writing 'system_b' (bootloader) *****************************************************
(bootloader) WARNING: OEM images are required in the LOCKED state.
(bootloader) Flashing images can result in a non-boot condition.
(bootloader) Flash a proper OEM signed boot.img first.
(bootloader) *****************************************************
(bootloader) flash permission denied
FAILED (remote: '')
Finished. Total time: 5.492s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot flash oem oem.img
Sending 'oem__a' (237897 KB) OKAY [ 9.645s]
Writing 'oem__a' (bootloader) Invalid partition name oem__a
FAILED (remote: '')
Finished. Total time: 9.655s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase cache
Erasing 'cache' OKAY [ 0.003s]
Finished. Total time: 0.005s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase carrier
Erasing 'carrier' OKAY [ 0.015s]
Finished. Total time: 0.018s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase clogo
Erasing 'clogo' (bootloader) Invalid partition name clogo
FAILED (remote: '')
Finished. Total time: 0.006s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase userdata
Erasing 'userdata' OKAY [ 2.667s]
Finished. Total time: 2.670s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot erase ddr
Erasing 'ddr' OKAY [ 0.018s]
Finished. Total time: 0.021s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot oem fb_mode_clear
OKAY [ 0.004s]
Finished. Total time: 0.006s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>fastboot reboot
Rebooting
Finished. Total time: 0.006s

C:\Users\William\Desktop\Moto X4 softwares\platform-tools - Copia - Copia>pause1>nul

Ps. The developer mode is disabled.