How to fix "Encryption unsuccessful" and bootloop issue on Andriod 8.1? My Nexus 6p boot looped and is showing "Encryption unsuccessful" error with a RESET PHONE button. Resetting the phone is not helping and it shows the same "Encryption unsuccessful" error again.

Device is unlocked and I am able to access bootloader and recovery. Sometimes it just bootloops however sometimes "Encryption unsuccessful" shows up after boot.

I am able to flash twrp etc. I tried flashing stock Android but its still the same.

This should be a simple thing to solve right. Any suggestions?

Thanks
This happened due to the infamous BLOD due to premature hardware failure of Qualcomm Snapdragon 810 chip set. All Qualcomm Snapdragon 810 chipset will have the same fate after around 1.5 years of usage. Can't believe Qualcomm messed up this bad.   

The instructions in the below linked worked perfectly.
https://forum.xda-developers.com/nexus-6p/general/bootloop-death-blod-workaround-zip-t3819515

The phone is surprisingly pretty usable for daily tasks even after disabling the A57 cores.