yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Illuminatus_:
Till now no signal ? drop for me in this rom, well done. Thank you developer.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] boka18:
Yup, same here. This ROM beats every other custom ROM for our device. great job dev! I think only bug is the camera, which is not that important because gCam works flawlessly
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] sreenucr7:
Does slow motion work fine ?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] RicardoPata:
What do you mean with "wiped everything"? I wipe data, cache and system, and don't touch in internal storage.

I have my phone encrypted, the only thing i don't wipe is the storage, and i try to install several times this rom and the fingerprint still don't work.

I also install the stock rom to see if the fingerprint is working and it is.

Any suggestions?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] JOSE_1889:
I have a problem with my daily use launcher on this rom. The launcher is next launcher 3d
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Affeys:
what the icon pack name sir?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Skalexs:
Sure, after testing ALL other ROMs, its so far THE BEST
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] milopo:
just want to share, highest score is with this rom. BEST.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] gundam311:
But camera stock is the best for our device
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
I too have the same fingerprint issue. There's no fingerprint settings for me on this.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Fractals:
logs
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
Logs are to be posted here or I have to send it to you someplace else?

Edit: sorry, I know I gotta PM you. Just give a 20-25 mins as I gotta reinstall Cardinal to get the logs.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Fractals:
Put in thread please I'm not a dev
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
......so who's gonna fix it then?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
Here. Find the attachment
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] ydd0ras:
These are self made icons. Made by the Icon Pack Studio app.

---------- Post added at 10:19 AM ---------- Previous post was at 10:17 AM ----------

Not really. I have compared it with a GCam mod for a long time. And imo the GCam is better.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] mattx01:
Found the solution for fingerprint. Just make the selinux to permissive.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
Yeah, but setting selinux to permissive breaks few banking apps. & we want this rom because it's got enforcing selinux.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] mattx01:
Yeah, maby this is bug for fpc sensor
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
Yeah, hope we get a fix for this soon.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] madhpharma:
Not facing any fp issue
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] vygavedha:
Anybody got tez working in this enforcing ROM?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] RicardoPata:
I install this ROM 4 or 5 times and never get logs sorry.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] sabdroid:
No luck with Tez.. ROM (enforcing) + Magjsk Hide (enabled):rolleyes:
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] binopech:
Great rom. Been using my mia1 as a daily driver because of this rom. For those having fp issues try flashing stock rom first then flash this rom. Havent faced fp issues in this rom.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
https://drive.google.com/file/d/1858ah8eJ8Yvmf0suGpfTyJSZHeNvH9wv/view

Those facing fp issues try this version of Cardinal. 25/04/2018
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] anoubhavcashyap:
Here are the screenies
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] boka18:
Hey Dev, I tried to build this ROM on my PC.. it gave me an error. Something like the : device/xiaomi/msm8953-common/msm8953.mk is missing or can't be found. Any help would be greatly appreciated. ^^
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] thelazyindian:
New Build: 26th April, 2018

Changelog:

- Fixed FPC fingerprint on selinux enforcing

- Fixed CardinalOTA crash on nav up

Links updated in OP. Enjoy!
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] dback31:
Thanks for the update

I'm wondering if you will also bring oreo Citrus-CAF to our device since you also brought us the nougat version of it and I absolutely love that ROM :)
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] RicardoPata:
Thanks for the update

I'm going to install this rom later :svetius:
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] madhpharma:
Thanks dev for excellent rom
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] pavan kanagi:
I appreciate the developers here to go with rom with more stability than with endless features with no stability.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] albsat:
Can someone please post the latest systemui.apk but directly from the rom ( untouched file) so that a dev can modify it for the fingerprint unlock option?

Thank you!
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] sauru.660:
There is already finger print unlock option enabled
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] albsat:
I meant fingerprint unclock without any other pattern. There is a thread on apps A1 forum for this modification.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] sauru.660:
Ohh..ok

Thread link
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] manan001:
Does this rom have persist wifi Mac loss issue after flash stock again?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] madhpharma:
I don't think so whoever flashed this rom, they will revert back to stock rom, such a stable and reliable rom this is, after flashing this no looking back.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Fractals:
ye
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] hulicow:
Hi, i want to try this rom.but I am afraid if this Rom touches the /persist partition. Does this rom touches /persist partition? Thanks.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] manan001:
I would request the dev to fix it as fix is out there is also enforce Linux fix implemented
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] radogost:
I have problems with this rom. When I'm blocking the screen my phone turn off and can't get turned on for like 5 minutes. Clean flash. Any solutions?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] boka18:
Blocking the screen? Can you please elaborate?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] ydd0ras:
I am using that ROM from beginning and have never faced such behaviour. Any custom kernels or mods?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] TedGok:
Is there a function there i can hide the clock on the lockscreen in this good rom?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] sauru.660:
No...but u can do via Substratum
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] TedGok:
Thanks will test it :svetius:
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] radogost:
I've figured it out. ROM destroyed my persist partition and my phone was restarting every minute. Fixed by going back to stock & applied persist fix
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] ydd0ras:
Nice. Thanks for feedback!
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] thelazyindian:
I don't think it's a persist issue and ROM doesn't mess with persist partition FYI. Please attach logcat, dmesg while reporting issues/bugs.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] RicardoPata:
Excelente rom, now for me everything just work fine inclusive the FP.

Thanks, keep the good work
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] exodius48:
[MENTION=7513094]thelazyindian[/MENTION] This rom has bug same other roms, that is LED notification does not lit while offline charging.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] JOSE_1889:
I was using this ROM but i was unable to make or recieve calls. Any solution?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] neon_nath:
How to install updates??
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Ravi_sh594:
Great greater greatest ROM..thanks
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] boka18:
Wipe all, and reflash

---------- Post added at 07:27 AM ---------- Previous post was at 07:23 AM ----------

This is how I do it, and it always works.

1. Boot into fastboot

2. Boot into recovery via fastboot (fastboot boot recovery.IMG)

3. Wipe system and cache

4. Flash update (ROM)

5. Flash twrp

6. Reboot into recovery (No switching from a to b or the other way around)

7. Flash gaaps

8. Flash magisk

9. Reboot to system

10. Enjoy
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] pooniaprashant:
does the unlocking and rooting method mentioned in the op works, as i have seen many threads with "patched boot" for rooting stock?

Note: i need to root stock 1st to backup my user apps so i dont have to redownload them
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] troyinjapan:
Is there a way to enable the screenshot option when pushing the power button? I couldn't find the setting to enable that. Does it exist in this rom?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] TedGok:
Volume down and power takes screenshoot :svetius:
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] iH8Rain:
I assume you want the screenshot option to be in the power menu? The option should be under the hardware button settings
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] ydd0ras:
Guys, no one have issues while streaming music over Bluetooth? Am I the only one?
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] troyinjapan:
Yes, this is what I mean. No, it's not there or I can't find it.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] praviappu:
Does Tez works on this ROM??
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] madhpharma:
No
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] praviappu:
Thanks for the update
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] exodius48:
Weird screen while playing video [MENTION=7513094]thelazyindian[/MENTION]
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Dasseem:
Follow the quoted instruction, I do the same while upgrading ROM, it works without issues.
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] radogost:
My persist problem was not ROM related, apologizes to [MENTION=7513094]thelazyindian[/MENTION] - it was kernel fault (my device was turning off every minute) I reflashed from stock and now it's my daily driver. Sorry and congratulations on a great rom!
[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Taruxoph:
Is there a difference on signal reception between stock and Cardinal? Tx!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] blankaf:
Team Win Recovery Project

WHAT IS TWRP?

Oh come on, you know what it is - don't try to fool me!

In case you're serious, though...

Team Win Recovery Project is a custom recovery for Android devices.

It allows you to back up and restore your data, flash custom ROMs to your device, repair broken file systems, and root your device.

Read more about TWRP here: https://twrp.me/about/

DOWNLOAD:

1) Install the TWRP app from the Play Store or grab the apk from our website

2) Open the app, agree to the terms, and enable root access

3) Select TWRP Flash

4) Search for your device and select the version you wish to download

5) Once the download is complete, select the file (it's usually in your downloads folder) and then Flash Recovery

OR:

Most devices can be updated quickly and easily within TWRP if you already have version 2.8.4.0 or higher installed

1) Download the latest version from our website on your device

2) Reboot to TWRP

3) Hit Install and tap the "Images..." button in the lower right

4) Browse to the location of the TWRP image on your device and select it

5) Select recovery from the partition list and swipe to flash

OR:

You can find more information and download links on our website.

FEATURES:

FBE Decryption support

MTP support

ADB root

SUPPORT:

Live support is available via #twrp on Freenode with your IRC client or just click this link.

CONTRIBUTIONS:

Gerrit for TWRP: http://gerrit.omnirom.org/

Gerrit for officially supported devices: http://gerrit.twrp.me/

XDA:DevDB Information

TWRP for the Xiaomi Mi Mix 2, Tool/Utility for the Xiaomi Mi Mix 2

Contributors

blankaf, TheStrix

Version Information

Status: Stable

Created 2018-04-21

Last Updated 2018-07-08
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] blankaf:
Thanks [MENTION=5857684]TheStrix[/MENTION] for his work on TWRP for the Mi 6!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] blankaf:
Reserved 2
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] wight554:
Let's see how many guys gonna idolize u
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] DICKO1984:
Dreams come true ! Great job [MENTION=6635012]blankaf[/MENTION]
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] emap85:
I have the unofficial by raupe, can i upgrade in twrp with .img without any problem? Or will format my data partition?

thanks
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] PeppeCNN:
I did it without any problem
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] DICKO1984:
Already upgrade it from twrp unofficial without any issue! U can go for it
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] e.roc:
Hi all,

a Big thanks to TeamWin to make an official recovery.

I installed the recovery over the twrp by raupe, as i try to make a backup i go the following meassages in red:

Unable to locate ´/modem´partition for backup calculations

Unable to locate ´/splash´partition for backup calculations

Unable to locate ´/tz´partition for backup calculations

I guess it can´t be good to backup an get red notes

Any idea what does that means?

e.roc
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] DICKO1984:
Did you reboot on twrp first and try to backup After
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] e.roc:
i did, this messages showed up again.

But now, after i took the checkmark for backing up the system-image away this messeges dissapeared and no other red notes till the backup finished.

After this backup i include the system-image and ,surprise, no red notes anymore.

It looks like everything runs well now, i´m only wondering why this notes appears in the first place.

e.roc
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] nikibubu13:
On MIUI Global 9.5 stable flash twrp but geting overwritten constantly.How to proceed?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Mackay53:
Flash the no-verity-opt zip
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] nikibubu13:
no-verity-opt-encrypt-1.6 from unofficial twrp posts - correct?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
I think these messages are shown because of the settings of my unoffical TWRP that are stored in .twrp settings file.

Just delete that file and reboot twrp. Apply your settings again and you should be done.

---------- Post added at 11:09 AM ---------- Previous post was at 11:01 AM ----------
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
I know ;)

Therefore i aksked for the complete manaifest content. You can't build TWRP with only the device repo as single information.

Inaddition a precompiled kernel was used and i like to reproduce how it was build.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] PeppeCNN:
Hi!

Maybe someone can help me, i moved from raupe's twrp to official one. I tried to flash global dev MIUI from xiaomi.eu, but always goes in bootlop. i tried with both twrp but nothing...what can do?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Carlosk1966:
TWRP Password

Hallo.

I have official TWRP and Omni ROM. Before i flash last version i format data and wipe every thing.

When i boot to TWRP, need to enter password for Decrypt Data, if i have password for phone.

If i do not have password for phone, then no need for password in TWRP.

Is this normal?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Mackay53:
Yes no password on phone = no password on twrp
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hello [MENTION=6635012]blankaf[/MENTION] and [MENTION=5857684]TheStrix[/MENTION]

I tried to rebuild your TWRP with the information provided here in the thread.

I was successful somehow ...

... build TWRP runs smooth and TWRP was booting fine but the self built recovery was not able to decrypt the MIUI ROM based data partition (created with ROM miui_MIMIX2Global_8.4.19_fa49b22402_8.0.zip).

This was a bit surprising because the downloaded official TWRP was able to decrypt MIUI.

I did some investigation an found that several files differ.

This is absolutely reasonable for some files (bacause of different folder locations thy reference to and so on) but for some it's not.

My special attention is for files as follows:

ramdisk\init

ramdisk\file_contexts.bin

all listed files in ramdisk\sbin folder (see sceenshot/attached file)

I would be kindly ask you to publish the manifest files that have been used to build the TWRP that has a working encryption.

If possible the command that has been used to init the repo would also be very helpful.

Possibly my build environment has to many/wrong other projects activated that prevents me from building an recovery with working en-/decryption - your information could to an successful bug hunting ;)

Thanks in advance!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
OK missing link was the "init" file.

The file that was created from public available device tree files has encryption issues.

I extracted the one from the recovery that is hosted by twrp.me and placed it in "android_device_xiaomi_chiron/recovery/root/" - et violá: en-/decryption is working!

Assumtion:

init file is missing in device repo ...

init file is not delivered with prebuild kernel from device repo

Question:

Where does this init file came from?

How could it reproduced?

Thanks for your support
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Gingernut78:
Did you see this?

https://review.lineageos.org/#/c/LineageOS/android_device_xiaomi_msm8998-common/+/213215/
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Senexis:
OTG doesn't seem to be working when using a USB thumb drive. I simply cannot seem to mount it. I don't get any errors but it simply doesn't mount for some reason.

Sticking to Raupe's for now.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Hey [MENTION=4262001]Gingernut78[/MENTION],

thanks for the link - there where some interesting lines in it that have less the crypto n focus but more the handling of usb devices.

Could be interesting to play around with that because it leads a litte in the direction of the problem [MENTION=5180338]Sard Shift[/MENTION] mentioned.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kremmit:
Am I correct that with this recovery I can flash MIUI en LOS based roms?

Or do I need the Unofficial TWRP for flashing MIUI Roms?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] allrockedout:
The official twrp you can flash miui and custom roms. Encryption working in both.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] kremmit:
Thank you.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Greek13:
Working like a charm! Thank you. :)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
Hi boys, i would tell you my problem. I've tried to install a custom rom (omnirom and also lineageos) with this TWRP and nextgen TWRP. But my phone after installing the rom, root and gapps go into TWRP bootloop. Instead of the start of system I have TWRP start. I tried anything : fastboot command to erase cache and userdata, fastboot continue restart the recovery and clean install of anything. The curious thing is that i was able to install once the omnirom but after the first update i had this problem. From then i' m not able to update or install any system. The only thing i was able to do is the installation of lineage os (after fastboot command erase userdata) without root or gapps but system crash on start. And it is not configurable. I had to reinstall miui in fastboot mode. Can someone help me? Is a boot problem? A partition problem? Thank you
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Mackay53:
Twrp - format data - yes

If that doesn't work, repeat the process 3-4 times then reboot.

If that doesn't work, copy rom to PC, wipe system, then copy back and flash
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
Format data doesn't work. I tried to format data and restarting recovery several times. But this doesn't work. The roms were already on pc (with format data is required)
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] raupe:
Have you tried to install the rom and gapps in a seperate step?

As far as I remember I've read issues some people had with installing both in one step.

So first the rom, then one complete reboot and 5 minutes settle time then reboot to TWRP again and install gapps in a second step.

Please also notice any error messages that TWRP may display.

Good luck!
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
If i install only the ROM ... It boot up but the system crash without any possibility to configure the ROM. I've tried also the installation of system and after the reboot in recovery ... wipe cache and davilcache... but nothing. It is very strange because before with TWRP unofficial and omnirom the smartphone work very well.the problems were born with the first update. In that case i've restored backup and after the system started normally.
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Kartoffl:
Old roms were not built properly, thats why they still work with your old twrp. If you want to use new roms there is no other way than FORMATTING DATA one or more times with a new twrp.

Its really strange that you cant format your data in twrp, but i am pretty sure that twrp gives you an error in red when you try to format data. Please tell us what error it is.

Are you sure data is mounted?
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] Dado11:
I format data before the installation of any rom. TWRP works well and doesn't give me any error. The only thing that i'll try is format data and wipe all. Normally I only format data and install rom. Perhaps the problem is in the encryption. But I really don't know
[Xiaomi Mi Mix 2 ROMs, Kernels, Recoveries, & Other] linlinlin1992:
I had similar problems before. This is what I do:

1. Format data and wipe everything in advanced wiping (backup first of course; don't use TWRP to backup, transfer them to your computer for exmaple)

2. reboot to recovery again

3. (Optional) do 1 and 2 again.

4. Install the rom (mine is omni official) without installing Gapps. Reboot to system.

5. If you can successfully enter the system, reboot to recovery and full wipe (no need to wipe system and storage this time)

6. Install the rom again after full wiping. And install the GAPPS.

7. Reboot to the system and check whether there are system errors (e.g., google framework stopping etc.) If error persists, do the whole thing from 1 to 7 again.

If you have try flashing too many times before and doubt about whether the phone is alright. I would say it's safe to use official flash tool to flash the stock rom (using cable) all over again. That said, unblock, flash TWRP. Then the things above.

Check the warning in Omni Rom thread, roms before April 22 or something is encrypted somewhat wrong. So check also your rom is up to date.

P.S. To my shallow understanding, the first time installation is for encrypting the phone. Then the second time would give you a functioning rom lol.