INSTALL_FAILED_USER_RESTRICTED in Android Studio on a Redmi 4 device
Codemia Knowledge Hub ·
INSTALL_FAILED_USER_RESTRICTED on a Redmi 4 means MIUI's security settings blocked the app install that Android Studio started over ADB. Fix it in Developer options: turn on USB debugging and Install via USB, or disable MIUI optimization, and allow installs from unknown sources.
What the error means
The error appears when you install an application via ADB (Android Debug Bridge) and the device's user restrictions or settings prohibit the install. It is common on MIUI devices such as the Redmi 4 because of MIUI's strict security measures.
Why MIUI blocks the install
The error is usually caused by one of these:
- MIUI optimization: MIUI (MI User Interface) is Xiaomi's Android-based firmware for phones and tablets. Its enhanced security settings can restrict installations from unknown sources.
- Developer options: some developer options may be misconfigured, which blocks installing applications over USB.
- Security settings: MIUI often restricts installations that do not come from official app stores unless the user explicitly allows them.
Fix 1: Adjust Developer options
- Go to
Settings. - Navigate to
Additional settings>Developer options. - Scroll down to the
MIUI Optimizationtoggle and disable it. - Ensure that
Developer optionsis enabled. - Make sure that
USB Debuggingis switched on. - Verify that
Install via USBis enabled if the option is available.
Fix 2: Allow unknown sources
- Go to
Settings. - Navigate to
Security>Install apps from unknown sources. - Enable the option to allow installation from unknown sources.
If the install still fails
- If the physical device is cumbersome, use an emulator in Android Studio for preliminary testing.
- Regular updates: keep the device firmware and Android Studio up to date, which may resolve compatibility issues.
- Device-specific differences: different Redmi models may lay out these settings differently, so check the documentation for your specific device.
Related reading
- Install .ipa to iPad with or without iTunes
- Install shows error in console INSTALL FAILED CONFLICTING PROVIDER
- Installation failed with message Error android.os.ParcelableException java.io.IOException Requested internal only, but not enough space
- Installing ADB on macOS
- Installation Issue with matplotlib Python
- Installation of TensorFlow on windows 7 - ''pip3'' is not recognized as an internal or external command,
- Instantiate and Present a viewController in Swift
- Interface Builder What are the UIView's Layout iOS 6/7 Deltas for?
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.