[Solved] How to fix TWRP Error 7 while flashing a Custom ROM

If you have been installing Custom ROMs quite frequently like me, you are bound to face a few errors here and there.

Now, it is known that we use TWRP recovery in order to flash Custom ROMs because that is the most stable way to do it too.

However, TWRP recovery is also not bugless and there are a few bugs here and there that pop up from time to time.

One of those bugs or errors is the TWRP Error 7 which is very annoying when it does pop up.

If you are like me who has also faced the TWRP Error 7 then you are at exactly the right place. That’s because, in this guide, we will tell you the exact method to fix the TWRP Error 7.

Also Read: How to install TWRP recovery and root Samsung Galaxy Note 8

How to fix TWRP Error 7 (while flashing a ROM)?

TWRP Error 7
TWRP Error 7

Before fixing TWRP Error 7, we need to first understand why this error happens in the first place.

Basically, the TWRP Error 7 is a safety check that TWRP recovery does in order to see if the ROM that we are flashing is compatible with the phone that we have.

This is because you must have seen that every phone has its own Custom ROMs that are compatible only with that particular device.

Also Read: How to install Magisk without TWRP recovery

So if we flash a Custom ROM that is not compatible with our device then the device will end up getting bricked.

This will mean that the phone is almost dead and we have to go the route of restoring the device to Stock Firmware which is a day’s work on its own.

Now, the question is why would you face TWRP Error 7 even though you have downloaded the correct ROM for your device.

Yes, that is right. If you have also faced the TWRP Error 7, you would know that this error is coming up when you have a ROM compatible with your device.

Frankly speaking, even we don’t know why TWRP Error 7 is getting triggered even for correct ROMs.

But the main thing to note is that we have a solution for TWRP Error 7 and you need to follow the steps mentioned below to apply the fix and solve this error.

Also Read: How to use ADB sideload on Android [Stock and TWRP recovery]

Steps to fix TWRP Error 7

First of all, you need to download any unzip software such as WinZip or 7Zip if you don’t have it installed already.

Next, you need to download a text editor named Notepad++ which lets you edit text files in a simple manner.

Note: We are well aware that Windows comes with its own text editor called Notepad but we don’t recommend editing your text files and you should download Notepad++ for best results.

Step 1: Extract ROM zip file

  • In the first step, extract the ROM zip file using the unzip software that you just installed.
  • Open the extracted zip folder on your PC
  • Now, proceed with the next step in this process.

Step 2: Rename the “updater-script” file

  • In the unzipped folder of your ROM, go to the folder named META-INF and head over to this path: com>>google>>android.
  • Inside the android folder, you will find two files named updater-binary and updater-script. 
  • Here, rename only the updater-script file by right-clicking the file and selecting the rename option from the list of options.
  • Rename this file from “updater-script” to “updater-script.txt”
  • Basically, we have made this a text file now

Step 3: Open this file in Notepad++

  • Open this renamed file named “updater-script.txt” using Notepad++, the text editor that we just downloaded.
  • Here, you need to delete a few lines that are present in the “updater-script.txt” file.
  • The lines you need to delete will be typically found at the top and they start with:
assert{
  • Note that you need to delete these lines until the mount() section as shown in the screenshot below.
Updater Script file editor
Updater Script file editor
  • As per the screenshot, you need to remove the lines until mount().

Step 4: Rename the file once again and recompress it into a zip file

  • Once you have deleted these lines, save the file and rename it back from “updater-script.txt” to “updater-script”
  • Now, recompress all the files from the ROM folder with the help of 7Zip into a zip folder.

Step 5: Transfer the ROM zip file and flash it on your device.

  • After this, transfer the ROM zip file to your device and flash this ROM file via TWRP.
  • This will make sure that your Custom ROM gets flashed and the TWRP Error 7 is gone once and for all.

We hope that this method to fix the TWRP Error 7 was easy to understand and your problem got solved.

If you found this method a little too confusing then feel free to comment where you are facing a problem and we will try to solve your problem in a step-by-step manner.

Abhishek

Abhishek is the Founder, Owner, and also Chief Editor at TheAndroidLab and he looks after all the daily stuff that takes place here. If you have any queries related to this site, you can contact him via email at [email protected] or on his Twitter handle.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts