In this tutorial, we will show you how to fix the TWRP 20 Error that happens while flashing the GApps package, mostly with LineageOS Custom ROM. You will also get the following error message: GApp’s pkg is for Android 10.0.x ONLY. Please download the correct version for your ROM: 9 (SDK 28). The thing is you have downloaded the correct GApps package. Furthermore, your ROM is also Android 10 based, and not Android 9.0. Both these facts have been incorrectly mentioned in the Error message.
Likewise, if you have flashed the LineageOS, then your TWRP might be replaced with Lineage Recovery. this further complicates the entire matter. There have been various instances of this error message: from XDA Developers to GitHub to Reddit, many users have voiced this concern. But fret not. In this guide, we will help you understand the reason behind this error and how you could easily fix it as well. Follow along.
One of the biggest perks of having an open-source ecosystem like Android is the plethora of tweaks that it brings with itself. These include the ability to unlock the device’s bootloader, gain administrative rights by rooting via Magisk, flashing tons of modules, framework, Syubstratum Themes among others. Likewise, many users also prefer to install an altogether new build of Android OS in the form of Custom ROMs. This customized firmware offers a plentitude of features and customizations that the stock OS could not offer.
- How to Install OTA Updates in Rooted Android Device
- How to Permanently Install TWRP without TWRP ZIP File (only using TWRP.img file)
- Root Android Devices Without TWRP Recovery
- How to Fix TWRP Error 7 (While Flashing Custom ROM via TWRP)
Apart from that, you will also be getting Android upgrades beyond what the OEM has promised. Well, devices like OnePlus One that was launched in 2014 is still quite an active player in the community. If we talk about these custom ROMs, then a few big players include LineageOS, HavocOS, Pixel Experience, among others. Each of these ROMs mainly differs in their offerings. While LineageOS is a basic ROM that mostly focuses on stability, without adding many features.
On the other hand, HavocOS has incorporated tons of features and customization opportunities. Likewise, Pixel Experience, as the name suggests, gives you the cleanest and purest stock Android experience, just what the Pixel devices have to offer. Apart from that, there is another differentiating factor between these ROMs- Google Apps Package or GApps. ROMs like LineageOS don’t come with Google Apps and hence you will have to flash the Google Apps package separately. Whereas Pixel Experience is one ROM that has all the Google Apps, Services and Frameworks baked in.
The real issue arises when you have flashed the Custom ROM and then are about to flash these GApps. TWRP would straightaway throw the ERROR: 20 with this GApps file. Likewise, GApps will say that: “Gapp’s pkg is for Android 10.0.x ONLY. Please download the correct version for your ROM: 9 (SDK 28)”. This is followed by the Gapps installation failed message. So why does this happen in the first place? And more importantly how to fix this TWRP Error 20 issue. Well in this guide we will be addressing all these queries and will list out complete instructions set to fix this issue as well. Follow along.
- [GUIDE] Flash ROMs/Magisk/TWRP/Kernels on A/B Partition Devices
- Everything About Magisk- Manager, Modules, and More
- Best Magisk Modules of 2020 [PART-1]
- [3 METHODS] Unroot any Android Device-Uninstall Magisk
Why TWRP Error 20 with GApps Occurs?
To begin with, the TWRP Error 20 happens when you don’t reboot to TWRP after flashing the Custom ROM, rather you directly flash the GApps package. As a result, the boot partition (in case of A/B Partition devices) or the boot partition (in non-A/B devices) gets corrupted and unrecognized.
Furthermore, the next time you boot your device, chances are your TWRP recovery will be replaced by the LineageOS Recovery. All this makes it more difficult for the end-user. But, we would be making use of this issue only to find the fix. Sounds interesting right, well it definitely is! Here is what needs to be done from your end.
How to Fix TWRP Error 20 with GApps
The below instructions are listed out keeping the LineageOS in mind. This is because this issue seems to only with this said Custom ROM. With that said, as of now, you might have wiped the Data, System, and Cache partition and flashed the LineageOS custom ROM as well. And then you have flashed the GApps package but got the TWRP Error 20.
Given below, we have shared two different methods. The first one is relatively shorter than the second, but the second method comes with a higher success rate. Anyways, there is no harm in giving a shot to the first one, you might be among the lucky ones and this issue might be fixed within seconds. If not, the second method is always there.
METHOD 1: From TWRP Itself
- Head over to the TWPR Home screen and tap on Reboot.
- Then select the Recovery option. Your device will then reboot to TWRP.
- Now head over to Install and select the GApps package. Perform a right swipe to flash it, and this time you wouldn’t face TWRP Error 20 while flashing GApps.
DON’T MISS: We conducted a Rooting Poll involving the General Audiences and got some amazing results. Do check out our Rooting Survey Results! <VOTING LINES ARE STILL OPEN!>
METHOD 2: Via LineageOS Recovery
- Head over to the TWRP home screen, tap on Reboot, and then select System. Or if you are stuck on the TWRP Error 20 screen, then you could directly tap on the Reboot System button situated at the bottom right.
- Your device will then reboot to LienageOS.
- Skip through the setup and when you reach the home screen, you will have to boot your device to recovery. For that, there are three different methods: Via Hardware Key Combinations, From the Advanced Reboot Option of LineageOS, or the ADB Commands. We will be using the last one, i.e ADB command. So head over to Settings > About Phone > Tap on Build Number 7 times > Head back to Settings > System > Advanced > Developer Option > Enable USB Debugging.
- Likewise, you will also have to download and install the Android SDK Platform Tools. When that is done, head over to the platform-tools folder, type in CMD in the address bar and hit Enter. This will launch the Command Prompt.
- Now connect your device to PC via USB cable. Make sure Debugging has been enabled. Then type in the below command in the Command Prompt window to boot your device to the Recovery:
adb reboot recovery
- Your device should now reboot to the Lineage Recovery. Use the Volume keys to select the Apply Update option and hit the Power key to confirm the decision.
- Now if the GApps file is present in SD Card, use the Volume keys to highlight the Choose from the SDCard1 option and hit the Power key to confirm it. Then navigate to the GApps ZIP file using Volume keys and select the file using the Power key.
- The flashing process will now begin and should take some time, depending on which package you are flashing (Pico, Nano, Stock, etc).
- On the other hand, if the GApps package isn’t stored on your SD Card, then you will have to take the Apply from the ADB route. Hence select this method using the Power key.
- Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
- At the same time, transfer the downloaded GApps package to the platform-tools folder as well. It is recommended to rename it to gapps, so the complete name would then be gapps.zip.
- Now connect your device to the PC via USB cable, Make sure it is in ADB Sideload Mode from Lineage Recovery. With that done, now execute the below command in the CMD window:
adb sideload gapps.zip
- The GApps package will then be transferred from your PC and automatically be installed as well.
- When that is done, you may now reboot your device to the OS.
That is it. These were the steps to fix the TWRP Error 20 with GApps. Now you could easily sign in with your Google Account, restore all the data, try out your favorite Google Apps, and dive deep into the Google ecosystem. Rounding off, if you have any queries with respect to any of the aforementioned steps, do let us know in the comments section below. We would definitely get back to you with a solution.
NOTE: ALL IMAGES ARE TAKEN BY THE ADMIN OF DROIDWIN.COM. YOU MAY NOT USE IT ON YOUR SITE FOR ANY PURPOSE, WITHOUT CREDITING THIS SITE (DROIDWIN.COM)
A/B Partition Guides
- [GUIDE] Flash ROMs/Magisk/TWRP/Kernels on A/B Partition Devices
- How to Flash Various Files in A/B Partition Devices
- Install Custom ROMs on any Android Device- Includes A/B Partition
- How to Fix FAILED (remote: unknown command) Error