The Android.process.media bug has occurred** on Xiaomi smartphones (including Redmi, POCO and Black Shark models) is one of the most common system problems that can occur after a MIUI update, app installation, or even for no apparent reason, leading to sudden reboots, interface freezes, and inability to open a gallery, music or downloads. 80% of the time, the error is due to damage to media cache or access rights conflict, but sometimes it is caused by deep system failures.
Unlike similar errors on other Android devices, the problem is often exacerbated on Xiaomi by the features of MIUI firmware - its aggressive background optimization and limitations on system processes. For example, after upgrading to MIUI 14 or HyperOS, many users find that the error appears cyclically, even after a reboot. In this article, we will discuss 7 proven ways to fix the failure - from simple (cleaning the cache) to radical (resetting to factory settings), and also explain how to avoid data loss.
Why is the Android.process.media error on Xiaomi
Android.process.media is responsible for working with media files: gallery scanning, music playback, download processing. On Xiaomi, it is closely integrated with MIUI branded services such as:
- π· gallery MIUI (com.miui.gallery β manages the display of photos and videos;
- π΅ Music (com.miui.player) β responsible for audio files;
- π Files (com.android.documentsui) β scans the storage;
- π Media provider (com.android.providers.media) β creates a media database.
The main causes of failure:
- Damaged cache β After updating MIUI or installing applications, the media cache may conflict with the new version of the system.
- Access Rights Conflict β MIUI blocks background activity of system processes through Security β Permissions.
- Broken photos or videos in DCIM, Downloads folders can cause a scan failure.
- Update error β incorrect installation of the OTA-package MIUI leads to a rupture of dependencies of system applications.
- Virus or malware β some Trojans disguise themselves as media services and block their operation.
Interestingly, on the POCO F5 and Redmi Note 12, the error often appears after connecting to the PC in file transfer mode (MTP), which is due to the fact that MIUI temporarily blocks access to the storage, and the media process cannot synchronize changes.
Method 1: Cleaning up cache and media service data
In 60 percent of cases, the bug is fixed by simply cleaning the cache of system applications, a method that doesn't delete your files, but resets temporary data that may have been corrupted.
Instructions:
- Open Settings β Applications β Application Management.
- Click on the three dots in the upper right corner and select Show System Processes.
- Find and open alternately: Media Storage (com.android.providers.media); Downloads (com.android.providers.downloads.ui); Gallery (com.miui.gallery).
Clear the cache
Clear the data
Reboot your smartphone.
βοΈ Preparation for cache cleanup
Important! Once com.android.providers.media has been cleaned, the system will re-scan all the media files, which can take anywhere from 5 to 30 minutes depending on the storage capacity, and during this period, do not open the gallery or the music.
β οΈ Warning: If the error repeats after cleaning the cache, do not repeat the procedure - this may lead to a reboot cycle.
Method 2: Resetting application permissions
MIUI aggressively manages application rights, and sometimes system services lose access to storage or contacts, and resetting permissions will bring back the settings to factory settings without losing data.
How to reset permits:
- Go to Settings β Applications β Permissions.
- Click on the three dots in the top right corner and select Reset App Permissions.
- Confirm the action and restart the device.
If this item is missing (on some versions of MIUI), use an alternative method:
adb shell pm reset-permissionsThis command must be entered through ADB (by connecting your phone to your PC), and you will find detailed instructions on how to set up ADB for Xiaomi below.
π‘
After resetting permissions, check that the Gallery and Files apps have access to storage. Go to Settings β Privacy β Permits β Storage and enable system service sliders.
Method 3: Delete damaged media files
Broken files in DCIM, Downloads, or Pictures folders can cause a scan to crash to find them:
- Connect your phone to your PC in File Transfer (MTP) mode.
- Open the internal storage and check the folders: πΈ DCIM/Camera β photo and video; π₯ Downloads β Downloaded files; π΅ Music or Ringtones - audio files; π Pictures/Screenshots β screenshot.
Delete files with zero size (0 KB) or those that do not open on your PC.
To automatically search for broken files on Windows, you can use the MediaInfo utility or the command in PowerShell:
Get-ChildItem -Path "D:\DCIM\" -Recurse | Where-Object { $_.Length -eq 0 } | Remove-Item -Force(Replace D:\DCIM\ with the path to your folder.)
β οΈ Note: If you delete files directly from your phone through Explorer MIUI, First, turn off the Settings option. β Warehouse β Make room β Autocleaning, otherwise the system may delete the files.
Method 4: Update or rollback MIUI
If the error occurred after the system update, it may be the fault of the firmware, in which case it will help:
- π Update to the latest version MIUI (if available);
- π Recoil on the previous stable version (if the error appeared after the update).
How to update MIUI:
- Go to Settings β About the phone β System update.
- Click Check Updates and install the latest version.
- If the update doesnβt help, download the full firmware package (Fastboot or Recovery) from the official Xiaomi website and sew manually.
To revert to the previous version:
- Download stable firmware for your model (for example, for Redmi Note 11 it can be MIUI 13.0.5).
- Rename the file to update.zip and place it in the root of the storage.
- Go to Settings β About Phone β System Update, click on three dots and select Select Update File.
| Xiaomi model | Last stable MIUI (as of May 2026) | Recommended version for rollback |
|---|---|---|
| Redmi Note 12 Pro+ | MIUI 14.0.9 | MIUI 13.0.12 |
| POCO X5 Pro | HyperOS 1.0.3 | MIUI 14.0.6 |
| Xiaomi 13 | HyperOS 1.0.5 | MIUI 14.0.8 |
| Black Shark 5 | MIUI 13.0.20 | MIUI 12.5.15 |
On models with a chipset Snapdragon 8 Gen 2 (for example, Xiaomi 13 Ultra) rollback MIUI 13 can lead to locking the bootloader. Before the procedure, check the firmware compatibility on the Xiaomi forum EU.
Method 5: Reset to factory settings (Hard Reset)
If the previous methods didn't work, the radical solution is a complete reset, which will delete all the data, so back up first.
How to reset your settings:
- Go to Settings β About the phone β Reset settings.
- Choose to erase all data and confirm.
- After restarting, set your phone as new.
If the system does not boot (cyclical restart), reset via Recovery:
- Turn off the phone.
- Press Volume Up + Power before the Mi logo appears.
- Select Wipe Data β Wipe All Data (control β volume buttons, confirmation β power button).
What if there is a mistake after the reset?
β οΈ Warning: On devices with an unlocked bootloader, the reset may result in Anti-Rollback blocking.Be sure to access the Mi Account linked to the phone before the procedure.
Method 6: Checking for viruses and malware
Some Trojans (e.g. Android.Triada) disguise themselves as media services and block their operation.
- Install antivirus (recommended Malwarebytes or Dr.Web Light).
- Run a deep scan.
- Remove the threats found and restart the device.
If the antivirus does not find anything suspicious, but the error remains, check the list of installed applications:
- π Remove applications that have requested access to Warehouse or Contacts without cause.
- π« Note the programs with names like Media Service, Gallery Helper β these can be fakes.
π‘
Viruses often penetrate through APK-files downloaded from third-party sources. Always check the hash of the file before installing (for example, via VirusTotal).
Method 7: Manual fix via ADB (for advanced)
If you are familiar with ADB (Android Debug Bridge), you can manually restart media services or fix access rights.
Instructions:
- Install Platform Tools on your PC.
- Turn on USB Debugging on your phone (Settings β About Phone β MIUI version β press 7 times, then go back to Additional β For Developers).
- Connect your phone to your PC and type in the commands: adb shell su pm clear com.android.providers.media pm clear com.miui.gallery reboot
If you do not have root rights, use an alternative method:
adb shell am force-stop com.android.providers.media
adb shell pm clear com.android.providers.mediaHow to set up ADB for Xiaomi:
- π₯οΈ Download Platform Tools and unpack.
- π± Turn on Debugging. USB and Unlocking OEM developer-setting.
- π Connect your phone to your PC and confirm your trust in your computer.
- π In the command line (in the folder with ADB) Enter adb devices β the serial number of the device should appear.