In this guide, we will show you the steps to fix the issue of being unable to relock the bootloader on Android and instead getting Fastboot: Error: Command Failed error. While stepping into the custom development brings in a plethora of goodies with itself, but on the flip side, it also paves the way for the entrance of a few bugs and issues. From SafetyNet getting tripped to banking apps not working and Widevne L1 being downgraded to L3, there are quite a few caveats attached to it.
Combine all these factors and we could clearly see why many users wish to revert to the stock ecosystem sooner than later. However, that is proving to be easier said than done for many. Numerous users have voiced their concern that they are unable to relock the bootloader on their Android devices and instead getting Fastboot: Error: Command Failed error. If you are also facing the same issue, then this guide will help you out. Follow along for the fix.
Fix Cannot Relock Bootloader on Android- Fastboot: Error: Command Failed error
It goes without saying that before you relock the bootloader, your device has to be completely stock. And by that, we don’t only mean stock firmware, instead, it should not have any traces of custom binary as well. Even if one single file related to a module is left behind, then your device will prevent you from relocking the bootloader [which in fact is great otherwise your device would have gotten hard-bricked].
While generally flashing the Fastboot ROM for your device should be more than sufficient, but just to be double sure, it’s recommended that you first remove all the modules, unroot your device, and then only flash the Fastboot ROM. Moreover, if given a choice, never choose the option to relock the bootloader while the flashing is going on. Instead, do so after the flashing is over and you are booted to the OS.
STEP 1: Remove Modules
- Launch Magisk, go to Modules, and tap on Remove next to each module.
- Along the same lines, disable and remove all the LSPosed modules as well.
- Likewise, uninstall any third-party mods present on your device.
- Once done, restart your device for the changes to take place.
STEP 2: Unroot Device
- Launch Magisk, tap on Uninstall, and select Complete Uninstall.
- Then wait for the process to complete and tap on Reboot.
STEP 3: Flash Stock Firmware
Now comes the all-important question- how to flash the firmware? Well, the process varies depending on the device that you own. Here are some of the most noteworthy ones [do note that irrespective of the method you opt for and the device you own, the process will wipe off all the data on your device, so please take a backup beforehand].
Pixel: Android Flash Tool OnePlus: Fastboot Enhance Tool | MSM Download Tool Xiaomi/Redmi/Poco: Mi Flash Tool Samsung: Frija Tool
STEP 4: Relock the Bootloader
Once you are booted to the OS after flashing the stock firmware, you could now relock the bootloader on your device using the detailed instructions given in this guide. Or, in short, just execute either of the two below commands [with your device booted to Fastboot Mode]:
fastboot flashing lock fastboot oem lock
That’s it. These were the steps to fix the issue of being unable to relock the bootloader on your Android device and instead getting Fastboot: Error: Command Failed error. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.
- Poco F5 CTS Profile Match Fail on Locked Bootloader [Fix]
- Fix OnePlus OEM Unlocking greyed out: Connect to the Internet
- Fix Failed (remote: invalid android images, skip locking) when Relocking Bootloader
- Change Region on Realme Devices via OTA [Locked Bootloader]