Failed -remote 39-flashing Lock Flag Is Locked. Please Unlock It First 39-- Updated

This error typically occurs when trying to flash firmware or system images to an Android device (often those with Unisoc/Spreadtrum chipsets) via Fastboot while the bootloader is still locked.

To resolve this, you generally need to unlock the bootloader before the device will accept the flash command. Common Fixes

Reboot to Bootloader: Ensure you are in the actual "Bootloader" or "Fastboot" mode, not "Fastbootd" (userspace). You can try running:adb reboot bootloader

Run the Unlock Command: Once in the correct mode, try running the standard unlock command. Warning: This will wipe all data on the device.fastboot flashing unlockNote: Some devices may require fastboot oem unlock instead.

Enable OEM Unlocking: If the command fails, ensure you have enabled OEM Unlocking and USB Debugging in the "Developer Options" menu within the phone's settings.

Verify State: Check the current lock status by running:fastboot getvar all or fastboot flashing get_unlock_ability

If you are using a specific flashing tool (like SPD Upgrade Tool or a specialized ROM flasher), ensure the device is connected in the correct state and the necessary drivers are installed.

Lock and unlock the bootloader | Android Open Source Project

The error "FAILED (remote: 'Flashing Lock Flag is locked. Please unlock it first')" indicates that your device's bootloader is currently locked, preventing you from flashing custom partitions like recovery, boot, or system.

To resolve this, you must explicitly unlock the bootloader through the following steps: 1. Enable "OEM Unlocking" in Android This error typically occurs when trying to flash

Before using fastboot commands, you must authorize the device to be unlockable: Go to Settings > About Phone.

Tap Build Number (or MIUI Version on Xiaomi) 7 times to enable Developer Options.

Go to Settings > System/Additional Settings > Developer Options. Toggle OEM Unlocking and USB Debugging to On. 2. Execute the Unlock Command

Once enabled, reboot your device into Fastboot Mode (usually by holding Power + Volume Down while booting) and connect it to your PC. Use one of the following commands based on your device: Standard Android: fastboot flashing unlock. Older Devices: fastboot oem unlock.

Critical Partitions (if needed): fastboot flashing unlock_critical.

Warning: Unlocking the bootloader will wipe all user data (factory reset) for security reasons. 3. Device-Specific Requirements Some manufacturers require additional proprietary steps:

Xiaomi/HyperOS: You must bind your Xiaomi account in the "Mi Unlock Status" settings and use the official Mi Unlock Tool on a PC. There is often a mandatory waiting period (e.g., 168 hours).

Google Pixel: Most allow unlocking immediately via the standard command unless they are carrier-locked (e.g., Verizon models).

Unisoc Devices: May require specific scripts or third-party unlockers to bypass the lock flag. Part 1: What Does This Error Actually Mean

Are you using a Xiaomi device, or a different brand like Google Pixel or Motorola? Fix Device State Locked Unlockable in Fastboot Mode

The error "FAILED (remote: '39-flashing lock flag is locked. Please unlock it first')" occurs when you attempt to flash firmware or partitions to an Android device while its bootloader is still in a "locked" state. Simply enabling "OEM Unlocking" in your phone's settings is not enough; you must also execute the specific unlock command through Fastboot. Step 1: Preparation (In Android)

Before you can run the unlock command, your phone's OS must permit it.

Enable Developer Options: Go to Settings > About Phone and tap the Build Number (or MIUI version for Xiaomi) 7 times.

Toggle OEM Unlocking: Navigate to Settings > System > Developer Options and switch on OEM Unlocking.

Enable USB Debugging: While in Developer Options, turn on USB Debugging. Step 2: Enter Fastboot Mode Connect your phone to your PC via a USB cable. Open a terminal (CMD or PowerShell) on your PC.

Type adb reboot bootloader and press Enter. Your phone should reboot to a screen showing "Fastboot" or a similar logo. Step 3: Run the Unlock Commands

Try these commands in order. Warning: This will wipe all data on your device. For most modern Android devices: fastboot flashing unlock Use code with caution. Copied to clipboard For older or specific legacy devices: fastboot oem unlock Use code with caution. Copied to clipboard If the error specifically mentions critical partitions: fastboot flashing unlock_critical Use code with caution. Copied to clipboard

Note: Some devices will display a confirmation prompt on the phone screen. Use the Volume keys to select "Yes" and the Power button to confirm. Step 4: Troubleshoot "Unknown Command" If you receive a "Command failed" or "Unknown cmd" error: often contains the lock flag)

Xiaomi/Redmi/Poco: You cannot unlock using standard fastboot commands. You must use the official Mi Unlock Tool after binding your Mi account in the Mi Unlock Status settings.

Motorola/Sony: These often require a unique "Unlock Code" obtained from the manufacturer's website.

Unisoc-based devices: Standard commands often fail; you may need a specialized tool like the TomKing62 CVE Unlocker.

Drivers: Ensure the Google USB Driver is installed. If your PC says "waiting for device," check your Device Manager to ensure the phone is recognized as "Android ADB Interface". Step 5: Verify Status To confirm your device is truly ready for flashing, run:


Part 1: What Does This Error Actually Mean?

Let's break down the error message piece by piece.

Introduction

  • Context: Embedded device firmware flashing process failed due to a hardware/software lock preventing remote flashing.
  • Scope: Investigate causes, reproduce conditions, propose diagnostics and fixes, and recommend preventive measures.

Q1: Will unlocking the lock flag void my warranty?

A: In most regions, yes. Manufacturers consider unlocking the bootloader as a warranty-voiding action, though some (like OnePlus and Google) allow it with caveats.

Part 4: Prerequisites Before You Attempt to Unlock

Before diving into unlock methods, ensure the following:

Title

Failed -remote 39 — flashing lock flag is locked. Please unlock it first 39--

1.3 please unlock it first

The error is politely telling you exactly what to do: unlock the flashing capability before attempting any write operations.

In essence, the device is saying: "I see you want to flash something, but my security says no. Go through the official unlocking process first."


7.2 Keep a Backup of Critical Partitions

Use dd or mtkclient to back up:

  • preloader
  • bootloader / aboot
  • nvram / nvdata (IMEI/store calibration)
  • seccfg (security config, often contains the lock flag)
Scroll to Top
0 Shares