[OnePlus 5 Questions & Answers] iwantademo123:
My experience with the 5.1.4 update - ERROR 7 & Treble error fix

Hi, I have 3 OnePlus 5's in my household and I have gotten them all to update to 5.1.4, then 5.1.5, then 5.1.6+ with this method.

(5.1.4 and then 5.1.5 is needed before flashing 5.1.6 or greater).

In my experience, no matter what caches I cleared or what recoveries I had used, 5.1.4 was not flashable on all three devices with the bootloader unlocked. If you have the patience and time, this method should 99.99% work for you if done correctly (leaving a 0.01% chance of failure just in case it does fail lol but that shouldn't happen.)

1.) Firstly, back up your device. I suggest doing this by making a full titanium backup, and copying all the files on the internal storage to a folder on your computer.

This may take a while to copy. In my experience, the fastest way to copy all the data off to the computer is to boot the device into TWRP recovery, plug a good USB C cable in to the device and to the PC's USB port, unlock the device in TWRP (put in the password/pattern to decrypt and mount the data partition [Ignorable if you dont set a password on the device]), and use the adb pull command to pull the files off the device. I found that ADB pull works much faster than an mtp file transfer in windows explorer.

Steps for ADB pull:

Ensure adb is installed on the computer with adb drivers. For Windows, open command prompt or powershell as admin. Type in adb devices and hit enter. If your OnePlus device comes up, then all is good. Use the command (without the square brackets):

[ adb pull /sdcard "XXX/." ]

Replace XXX with a directory on your computer (for example, you can do [ adb pull /sdcard "C:\Users\YOURUSERNAME\Desktop\OnePlus/." ]

If anyone notices any issues with this command please let me know so I can update the post. I am writing this off memory, so there may be minor mistakes.

2.) After your device backs up and you're happy with the backup (i.e. everything you need backed-up is saved off of the phone onto the computer), It's time to relock the bootloader and restore the firmware on the phone.

I haven't tried a simple fastboot OEM relock command, so I cannot say whether that is sufficient enough.

What I did was follow this thread:

https://xdaforums.com/oneplus-5/how-to/unbrick-tool-oneplus-5-t3648169

Download the Driver and the Oxygen version.

Once downloaded, extract the driver Driver_OnePlus5.zip file to its own folder. Extract the firmware to its own folder (cheeseburger_23_O.13_170803).

3.) Using the firmware restoring tool to relock the bootloader and restore the device to factory firmware condition.

Now:

Turn off your OnePlus 5 device.

Hold volume up key.

Plug USB cable in to the PC and the Type-C side to the device. Make sure only volume up is held whilst you do this.

Open device manager and check for missing drivers/driver issues. If the driver isn't detected, use device manager to browse for the extracted Driver_OnePlus5 folder you made earlier.

The LED light on the OnePlus 5 should be yellow if I can remember correctly.

Open msm download tool as an adminstrator (right click, run as administrator)

Click the start button on the top left of the msm download tool. (If nothing happens, make sure drivers are installed properly and that the device is in download mode [Repeat the above steps])

If successful, one of the "Device Type" should show your device connected {com device} and the download process and time row will update. Wait for the download progress to finish. The device will reboot on its own when completed. The status should turn green and say done/finished (If I remember correctly).

When your device reboots, do a quick setup. Don't bother putting your google account in or restoring anything if you plan on unlocking the bootloader later for TWRP or other reasons.

Unlocking the bootloader will wipe the phone. For now, just focus on the updates.

Connect the device to Wi-Fi. I found one of the devices I used this method on wouldn't connect to Wi-Fi (modem issue or something). Luckily, I had the 5.1.4 update already downloaded on the computer so I copied the update to the root folder on the device and used the local upgrade option in the OTA update options (in the phone system update settings). Updating the firmware fixed my Wi-Fi issue.

Basically, just do the OTA updates as you would normally. Start with 5.1.4, then you can do the 5.1.5. Do not jump to 5.1.7 because OnePlus only just added treble support in 5.14/5.15 releases so it is important do do those in order first. If you can, do 5.1.4, 5.1.5, 5.1.6 and then 5.1.7 in order. Just follow the updates that the OTA screen allows you to take.

Notes for the Pie update:

I haven't had issues installing Pie with the bootloader unlocked, so if you wish to stay on oreo for now and update later with an unlocked bootloader, that should be fine.

If your bootloader is locked, and you're on at least OOS 5.1.5, you should be able to flash the Pie OTA with the stock recovery without issues.

If you encounter issues installing Pie, and your bootloader is unlocked follow this:​

Unlocked bootloader - Pie Update - Removing compatibility.zip from firmware archive:​

Method 1: Pre-Removed compatibility.zip modified firmwares:

For STABLE:​

Follow this link:

https://xdaforums.com/oneplus-5/how-to/official-oxygenos-4-5-2-7-1-1-ota-t3627003

Download " OxygenOS 9.0.0 Full Zip (modified, without compatibility.zip) ".

For BETA:​

Follow this link:

https://xdaforums.com/oneplus-5/how-to/official-oxygenos-beta-1-android-oreo-t3710003

Download " OxygenOS Open Beta XX Full Zip (modified, without compatibility.zip) ".

You will need a Pie-compatible recovery. Download a compatible custom Recovery (TWRP) (Also available on https://xdaforums.com/oneplus-5/how-to/official-oxygenos-beta-1-android-oreo-t3710003 )

Flash a Pie-compatible TWRP and boot into it.

Copy the downloaded " OxygenOS Open Beta XX Full Zip (modified, without compatibility.zip) " to the device.

In TWRP, use: Wipe > Advanced wipe > Select dalvik-cache and cache > Swipe to wipe.

I would recommend taking a nandroid backup before proceeding, if you have any important data on the device.

Flash the downloaded " OxygenOS Open Beta XX Full Zip (modified, without compatibility.zip) ".

Wipe dalvik-cache and cache.

Enjoy Pie.

Method 2: Manual Method to remove compatibility.zip for unlocked bootloaders:

Download the FULL firmware OTA (from device settings, or from the OnePlus website).

Copy the firmware to the computer (If downloaded on the device, it will be in the ".ota" folder. Else, it is available on the OnePlus firmware downloads page.

Open the firmware archive with 7-Zip.

Delete Compatibility.zip from the archive.

Copy the now-modified firmware back to the device.

You will need a Pie-compatible recovery. Download a compatible custom Recovery (TWRP) (Also available on https://xdaforums.com/oneplus-5/how-to/official-oxygenos-beta-1-android-oreo-t3710003 )

Flash a Pie-compatible TWRP and boot into it.

In TWRP, use: Wipe > Advanced wipe > Select dalvik-cache and cache > Swipe to wipe.

I would recommend taking a nandroid backup before proceeding, if you have any important data on the device.

Flash your manually-modified OTA/firmware archive in TWRP.

Wipe dalvik-cache and cache.

Enjoy Pie.

DO NOT use winrar or any other non-recommended programs to remove compatibility.zip. I found that winrar causes treble errors or error 7.

4.) Re-unlocking the bootloader & Restoring your data.

Once you've installed 5.1.5 or greater, you can now safely go into developer settings and enable oem unlocking, and then reboot to the bootloader to unlock the bootloader (which will wipe/erase the phone data but keep the version to whatever you updated it to). You may then proceed to install TWRP, magisk if you plan on restoring with titaniumbackup, and restore all your sd card contents (or the sd card contents that you need) back from the computer backup the the device (I usually use ADB Push whilst booted in TWRP recovery because it copies quicker than MTP).

Updates should work from now on ( I was able to install android PIE Beta with the bootloader unlocked [See the Pie notes above]. Only had issues with the 5.14 / 5.15 updates with the bootloader unlocked ).

Hope this helps. If anyone has any more information, or questions about this method, do share. Like I said earlier, if done correctly, this method should definitely work for you guys.