[Xiaomi Mi 8 Guides, News, & Discussion] p-we:
I have previously unlocked and modded several Xiaomi phones. However recently I got a MI8 and what I thought would be simple was quite problematic. Its solved now which is why I am writing this guide to help someone else in a similar situation. I'm not an expert but the issues I had could be relevant to other USB-C Xiaomi Qualcomm based phones from mid 2018 and later:

NOTES:

1) AMD Ryzen PC with B350 chipset would not connect in any fastboot mode procedure at all with Mi8 in my case. It could not unlock the phone or flash anything with fastboot. Go with Intel.

2) Use a good USB-C cable. One of mine worked for MTP transfers but did not work with fastboot stuff

3) If you get a request in TWRP to provide your password for decryption, this refers to the PIN used in Android security

4) If you have not unlocked your Xiaomi phone you must do this first before trying any of the steps below. There are many guides for this.

5) Follow the steps EXACTLY to avoid boot loops etc.

Issue 1: The commonly used ADB and Fastboot tools fail to flash TWRP recovery (Thanks to khanhdx https://xdaforums.com/member.php?u=7791242)

1) It is necessary to use Xiaomi's specific version of fastboot in their miflash_unlock tool.

2) Put phone in fastboot mode and connect to PC.

3) Go into the miflash_unlock directory which was used to successfully unlock the phone

4) Put your TWRP image file in that miflash_unlock directory

5) While mouse cursor is in the directory, Right click while holding down SHIFT and select 'Open PowerShell session here'

6) Type 'cmd' then Enter

7) Type 'fastboot devices' to see if fastboot sees your device.

8) If a device code is displayed then USB drivers could be adequate so try 'fastboot flash recovery twrp.img' (insert actual name of img file)

9) If either no device code shows up or the recovery flash fails you will need to update USB drivers

10) First uninstall any other previously installed ADB USB drivers

11) Download Xiaomi MiFlash tool at https://www.xiaomiflash.com/ which contains drivers which work

11) Before installing the drivers with the MIFlash tool, it is recommended to boot with 'Disable Signed Driver Enforcement' enabled first. Google that if needed

12) The driver installer in MiFlash is wonky but it works. Continue to say 'Yes' to all the weird driver install warnings and long latency delays. It gets there slowly and confirms successful installation one driver at a time

13) Repeat Steps 5 through 8

14) If the above doesn't work, take a look at the driver in Windows Device Manager under Android ADB Device. It should be signed by Xiaomi not Microsoft. Also try different USB ports and/or remove other USB devices.

Issue 2: Custom ROM such as LineageOS or Pixel Experience will fail to flash in TWRP with "Error 7" stating that you don't meet the minimal Xiaomi developer firmware version requirement

1) In my case starting out with the latest Xiaomi global developer ROM and flashing the latest developer Xiaomi firmware from https://xiaomifirmwareupdater.com/#stable did not help meet the requirement and Error #7 would not go away. According to some sources such things do happen with official Xiaomi ROM's.

2) You can do the solution mentioned here https://xdaforums.com/mi-8/how-to/guide-how-to-flash-poco-f1-roms-t3911336 but this is a hack and not a true solution as you will have to do this every time you update the ROM, and the phone might not work right as the dev's at LineageOS and others know what they are doing when they put in those insist lines.

3) A real solution is to meet the firmware requirement by flashing the latest Xiaomi EU weekly/developer ROM (i.e. NOT official Xiaomi) from https://xiaomi.eu/community/ before flashing the custom ROM of choice (Thanks to Xiaomi EU forums)

4) Go to TWRP and wipe everything except USB OTG option. Format data! Reboot to Recovery!

5) Transfer downloaded xiaomi.eu ROM zip file to phone via MTP and install it with TWRP. Reboot to System!

6) Allow phone to initialize it's first Xiaomi boot fully. When the MiUI welcome screen comes you can stop there. Boot into fastboot mode

7) Repeat steps in 'Issue 1' above to re-flash TWRP recovery back to the phone

8) Repeat Step 4

9) Transfer custom ROM zip and optional GAPPS zip files to phone via MTP and install with TWRP. :cool: