Error 7, a prevalent error that has been plaguing users when flashing LineageOS or its based custom ROM on their devices. What all it does is, it stops the installation process and make you wait proceed further until you fix it. But, if you caught up with Error 7 while installing LineageOS, fortunately, you can boot back to the previous ROM.
So if you are one from the same league – had a sleepless night trying fixing the error and want to resolve it up, I have got your back.
However, eliminating the Error 7 isn’t a daunting task only if you are aware of the reason for its occurrence. So below, we have a section for the unawares to comprehend the major causes necessary for getting rid of the error.
Primary Reasons for the Error 7
These are the most common reasons blocking your way down installing LineageOS on your Android smartphone. There might be a significant change that you probably are making any mistakes during the process; therefore, read the mentioned carefully so you can figure out the wrong.
- First and foremost, make sure that the LineageOS zip you are attempting to flash is meant for your device and variant. Often, we fall into installing a build that’s not technically suitable for our smartphone’s model.
- If you are trying to migrate from an unofficial build/variant to official LineageOS, you are inviting Error 7 to prompt out. In order to prevent it, a full data wipe (erases the entire phone’s data) needs to be performed every time you navigate your way from something other than an official build of LineageOS.
- When you see a Trustzone error in the TWRP/CWM before encountering Error 7, that’s a reminder for you to upgrade your bootloader before you install the ROM.
- Always shot for flashing the correct stock image that’s entirely compatible with your device manufacturer. Before you process to wiping out the data or installing the ROM, double-check with the vendor/modem/bootloader.
- Generally, the outdated recovery also causes Error 7, so make sure that you are flashing the latest available version of the recommended recovery image (TWRP in most cases) for your device.
You should confirm and rectify each of the bullet points mentioning the vital mistakes for the much-talked error, before heading continuing with the next section.
How to fix Error 7 while Installing Lineage OS
Method 1: Updater Script Hack
Don’t make use of this method unless you aren’t sure if the downloaded LineageOS zip is compatible supporting and a correct file for your device model. Editing Updater Script help into bypassing assert checks in recovery and enables you flashing the ROM without any checks, that might be causing Error 7 by modifying the ROM package. Below I have got you the how-to-do:
- Firstly, open (don’t extract) the Lineage OS ROM zip file by using any archiver utility (7zip, WinRAR, File manager, etc.)
- Next, navigate to the path – META-INF >> com >> google >> android >> updater-script
- Open the updater-script file in a text editor. You will see a few lines with the command assert with the model name of your device mentioned next to it.
- There should be NO mismatch with the codename of the device in the script or otherwise you’ll have to face Error 7 while flashing.
- Moreover, you got two options, either edit the code to match your device’s codename or delete all the lines having the command “assert & getprop.”
- Lastly, save the file and try to install the ROM now.
Method 2: Trustzone Error
While flashing LineageOS if you are getting Trustzone error following Error 7, you are better off going with the step listed below.
Solution: The outdated bootloader is the most likely cause for the coming of Trustzone error, if it doesn’t support your device Android version. So what needs to be done is to upgrade the bootloader – and that’s all you have to do.
You should do proper research whether or not your device’s bootloader level supports Lineage OS ROM, prior to flashing it. For more detailed information you can visit the Lineage OS official Wiki pages.
Method 3: Avoid Dirty Flashing
If you aren’t properly migrating from other ROM so it might also throw Error 7 on your way installing LineageOS. We often use “dirty flashing” as the top of the recommendation, but every time it’s not the best solution.
Dirty flash – if you don’t know – it is the process of flashing a new version of ROM over the top of the existing one, without choosing “Wipe Data/Factory Reset” option in recovery. It helps you to continue with retaining your data. However, according to ROM devs, when switching from a different ROM, the dirty flashing shouldn’t be done as it may brick your device and you can run into problems.
Dirty flash the same ROM over its different build, like going from older to the newer version is quite acceptable, but still not suggested since there might be some substantial changes made to core system frameworks.
Tip: It’s recommended that even if you wish to do dirty flashing, you should always wipe cache and Dalvik cache.
- In order to prevent the migration issue when doing dirty flash an official ROM, you can download the experimental build and dirty flash it first. And after it, download the latest nightly as OTA.
- Or you can perform a full data wipe or factory reset before installing LineageOS on your device. But don’t forget to backup your data if you intended to do a clean flash.
Now, if the error persists, try installing a different TWRP/CWM version and then attempt installing Lineage OS ROM.
After trying the above steps carefully, try to reinstall Lineage OS zip file. Hopefully the methods mentioned above will fix the issue. However if you’re encountering any issues, let me know in the comments section.