How I Fixed a Boot Loop during a LineageOS Upgrade

Today I upgraded my Android smartphone from LineageOS 16.0 to 17.1 and I decided to share some insights since I ran into several issues.

Upgrading the Recovery Image

According to the LineageOS upgrade documenation, “a newer LineageOS version may not install due to an outdated recovery”. When upgrading from 16.0 to 17.1, a new recovery image is mandatory. This is how you install it (you need to have adb and fastboot installed for that):

  • Download the recovery image for your smartphone
  • Reboot your phone into bootloader mode using the command adb reboot bootloader (the LED should now flash blue)
  • Check if the phone is properly connected using fastboot devices
  • Upload the new recovery image with fastboot flash recovery <your recovery filename>.img

The output should be similar to this:

Sending 'recovery' (13528 KB) OKAY [ 0.496s]
Writing 'recovery' OKAY [ 0.917s]
Finished. Total time: 1.426s

Note that the new recovery has no touch display input anymore. Instead, you can navigate using the the volume up and volume down keys. The power button is used as enter key.

Upgrading LineageOS and Google Apps

First, you need to download the new LineageOS image for your phone. In case you have Google Apps installed, you also need a new Google Apps package your the processor architecture of your phone (in my case this was arm and I chose the nano package).

The required steps are:

  • If not already enabled, activate USB debugging in your phone’s settings (Settings | System | Developer Options | Root Debugging or in older versions Root Access Options / ADB only)
  • Start sideloading in recovery using adb reboot sideload
  • Sideload the LineageOS image with adb sideload <your LineageOS image>.zip Note: on the phone a confirmation message will be shown that the process was successful, but on the computer the following confusing error message will appear: adb: failed to read command: Undefined error: 0. You can simple ignore this error as long the phone reports success.
  • Directly after sideloading the OS image, sideload the Google Apps (without rebooting in between!): Apply Update | Apply from ADB, then on your computer type adb sideload <google apps filename>.zip. Here I got the error signature verification failed once. I chose Install anyway on the phone to continue.
  • Navigate to the back arrow at the top left of the screen using the volume up key and confirm with the power button, then choose Reboot system now.

If you’re lucky, you’re already done now. If you encounter issues, continue reading.

Possible Issues

I encountered the following issues:

  • I tried installing 17.1 with the 16.0 recovery image. It does not work, you need to flash the 17.1 recovery first.
  • After sideloading my computer displayed the error adb: failed to read command: Undefined error: 0, while the phone displayed a success message. This is very confusing, but the error in the terminal can be ignored as long as the phone displays a success message.
  • My phone got stuck in a boot loop. With the old recovery image, there was no way to solve it. With the new recovery image, after a few minutes a screen appeared saying that “the Andorid system could not be started” with the options Try again and Factory Reset. At this point do not immediately perform the factory reset, in my case I was able to repair the installation. Apparently, a faulty Google Apps package caused the problems. The problematic package was When I looked at the download page again, a package from the day before was provided: With the “older” package it suddenly worked. Before, I had also tried different LineageOS image versions.

Bottom line: if you are in a boot loop situation, first try different versions of LineageOS images and also different Google Apps images. Remember to always install the LineageOS package first and then the Google Apps package directly afterwards. In some cases the boot loop can be solved like this.

The combination that ultimately worked for me was:

  • lineage-17.1-20200915-recovery
  • lineage-17.1-20200915-nightly
  • open_gapps-arm-10.0-nano-20200918

Now I can enjoy Android 10 Features on a 6 year old smartphone 😎

12 thoughts on “How I Fixed a Boot Loop during a LineageOS Upgrade

  1. Thank you, oh a 1000 thank you!
    I followed your steps and I don’t have to wipe my phone after a system update. Jah bless!

  2. Had the reboot into recovery boot loop so I tried as you suggested with the recovery, different version of gapps. I did both together so I am not sure which fixed it but going from 17 to 18 is now complete, no loss of data and no boot loop. Thanks for your post, appreciated.

  3. Update: It was Magisk that caused the boot loop, because against TopJohnWu’s advice, I installed it through the recovery. Might be one to add to the list, if you think it would help people.

  4. Is there any way to know how to do this with XA2 ultra? Have 2 slots A and B and i dont know how to fix the command to flash it.

  5. Wow, I’ve been flashing ROMs for a long time, and was about to fix a bootloop by wiping and starting over, but sure enough, flashing Gapps (NikGapps here) and Magisk after flashing the latest 18.1 on my Galaxy Tab A SM-T580 did the trick. Thanks for this post.

  6. Thanks for the grate tutorial! I was so afraid that my phone data are gone but if you don’t wipe something in the recovery nothing will be deleted.
    For my personally the lineageos recovery didn’t work but TWRP worked too.

  7. omg… THANK YOU!

    I made an update on my OP3 with LineageOS 18.1 & hab a bootloop afterwards…
    Everything should be backed up but I would have hated to restore everything.

    Your Tipp with the Gapps was golden! Again, thank you!

Leave a Reply

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