INSTALL_FAILED_USER_RESTRICTED : android studio using redmi 4 device

AndroidAndroid StudioAdb

Android Problem Overview


Android Studio with Failed Error

Got this freaky error

Installation failed with message Failed to finalize session : INSTALL_FAILED_USER_RESTRICTED: Install canceled by user.
It is possible that this issue is resolved by uninstalling an existing version of the `apk` if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

When trying to run the apk in my redmi 4 MIUI 8.5.4.0

OEM unlocking enabled

Solution Tried

  • MIUI optimization turned off
  • USB debugging turned on
  • Verify apps over USB turned on

NOTE: while turning on install via USB a pop up saying The device is temporarily restricted

Android Solutions


Solution 1 - Android

Steps for MIUI 9 and Above:

Settings -> Additional Settings -> Developer options ->

  1. Turn off "MIUI optimization" and Restart

  2. Turn On "USB Debugging"

  3. Turn On "Install via USB"

    MTP(Media Transfer Protocol) is the default mode.
    Works even in MTP in some cases

  4. Set USB Configuration to Charging

Solution 2 - Android

The device is temporarily restricted error appears in MIUI 8.5. To resolve the error you need to make WIFI off and make mobile data on and then enable the option “Install via USB” under "Developer Options" in "Settings". it will work for you.

Solution 3 - Android

In your mobile device,make sure you have enabled the following buttons.

Settings > Additional Settings > Developer options

  1. Install via USB
  2. USB Debugging (Security settings)

enter image description here

Solution 4 - Android

For me none of the above solutions worked. Instead i do following steps that solved the issue :

  1. Developer Options > Mi Unlock Status > Add account and device. (A success message will appear)
  2. Turn on USB Debugging.
  3. Turn on Install via USB.

Note : This is checked on Redmi MIUI Global 8.5 version.

This solution will specifically solve the issue if you have recently logged out of Mi account & again logged in.

Hope it may help someone.

Solution 5 - Android

For MIUI 9.6 works:
1. Become a developer: Settings >> About phone >> MIUI version tap 7 times.

2. Again Settings >> Additional settings >> Developer options (turn on) >> USB debugging (turn on) >> Install via USB (turn on).

3. You will be asked for permission through your MI account. Confirm permission.

4. Note: During the installation of the application, your device will give you 7 seconds to confirm the installation. Don't miss it!

Solution 6 - Android

Settings->Additional Settings->Developer Options

1) Turn ON Developer Options
2) Turn ON USB Debugging
3) Turn OFF MIUI optimization
4) Turn ON Install via USB

Solution 7 - Android

In my case, I pressed Deny unfortunately during first time installation. So I was getting INSTALL_FAILED_USER_RESTRICTED.

You can get modify this permission for app under permissions.

Settings->Permissions->Install via USB->{Your App}

You should have enabled below options too.

Settings->Additional Settings->Privacy->Unknown Sources

Settings->Additional Settings->Developer Options->Install via USB

Solution 8 - Android

For MIUI 12:

  • Developer options (On)
  • USB debugging (On)
  • Install via USB (On).
  • Allowed android system to install from Unknown apps

This worked for me but got an android security warning.

Solution 9 - Android

Xiaomi MIUI.

Options - Permissions - Install via USB (not the same item in Developers options!) then uncheck your disabled app

Solution 10 - Android

Reference

The same trouble with the same device has been here.

So, it's Xiaomi trouble, and here is a solution to this problem:

  • Go to the "Security" application and tap "Options" at top right corner

  • Scroll down to "Feature Settings" group, and look for "Permissions"

  • At there switch off "Install via USB" option, which manages the installation of the apps via USB and doesn't allow it.

On Latest Redmi Device:

Settings > Additional Settings > Developer Options > Developer options: Check the Install via USB option.

enter image description here

Solution 11 - Android

You have to enable developer mode then

settings -> additional settings ->

  • USB debugging: sets ON

  • Install via USB: sets ON (to do this you have to insert a sim card otherwise you'll not be able to enable it)

[![enter image description here][1]][1]

[![enter image description here][2]][2]enter image description here

Solution 12 - Android

  1. Just Disable Mock SD card optimization in the developer options
  2. Turn off "Turn on MIUI optimization"
  3. Mark force-closed apps

These Settings worked for me.Cheers!

Solution 13 - Android

If above answer didn't work for you as it didn't work for me on my Xiaomi Mi5.I tried to figure out the Core reason behind it and solve it. In MIUI, in order to change "Install via USB" option, you must be connected to the internet and signed in your Mi account. Due to some reason, requests from out of the China servers are getting rejected, so I connected to one open China VPN and tried again to enable 'Install via USB' and I got success. For detailed solution and VPN details, see this useful Youtube video: https://youtu.be/MeKUJlD-Ke4

Solution 14 - Android

How to Fix Install Failed User Restricted Failure in Android Studio - For Xiaomi Redmi Note 4X (100% worked for me) Settings=>Additional settings=>Developer Options

  1. Mock SD card optimization = OFF
  2. USB debugging = ON
  3. Install via USB = ON
  4. USB debugging (Security settings) = ON
  5. Verify apps over USB = ON
  6. Force-closed apps = ON
  7. Turn on MIUI optimization = OFF

Solution 15 - Android

For me, this works only Steps for MIUI 9 and Above:

Settings -> Additional Settings -> Developer options ->

Turn off "MIUI optimization" and Restart

Turn On "USB Debugging"

Turn On "Install via USB"

Set USB Configuration to Charging

MTP(Media Transfer Protocol) is the default mode. Works even in MTP in some cases

Solution 16 - Android

Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]:

Go to Settings->Additional Settings->Developer options->Developer Option(Need to enable)->USB debugging(Need to enable)->Install via USB (Need to enable)->USB debugging (Security settings)(Need to enable)

Perfectly working in the above steps.

Enjoy your coding...

Solution 17 - Android

To turn on "Install via USB" and "USB Debugging(Security changes)" need to sign in to xiaomi account then these 2 can be turned on and work with redmi as developer

Note:When turning on USB Debugging(Security changes) few security alerts will be poped up all need to be accepted to work on developer mode

Solution 18 - Android

With Xiaomi Redmi note 8 pro (MIUI 10.4.4), Android 9 -

While connecting to Vysor (2.1.2) from Windows PC (via USB cable), received the error message:

"Error installing APK: Failure [INSTALL_FAILED_USER_RESTRICTED]"

even after turning "USB Debugging" On.

So the following settings were required -

  • Developer options (On)
  • USB debugging (On)
  • Install via USB (On)

Leave the following,

  • Turn on MIUI optimization (On)
  • Verify apps over USB (On)

Solution 19 - Android

  1. Turn on usb debugging
  2. Turn on Install via USB :-> While turning on it asks for mi account sign in you can get instant otp vis sms service to sign in quickly.
  3. Turn off MIUI optimization.

Solution 20 - Android

NO NO NO !!!!!

it's simple, in MIUI 9.x you need developer settings ON and then

  • Settings -> (system & device section) Additional Settings -> Developer options

(Debugging section)

  • Turn On "USB Debugging"
  • Turn On "Install via USB"

Then in Android select Runb app and choose your Xiaome phone

EDIT: you will also need allow installation from unknown sources

Solution 21 - Android

Updated MIUI 12:

I have to turn on "OEM unlocking" beside other settings. (I don't need to change "Mi Unlock status"

Solution 22 - Android

what worked for me

  1. goto Settings -> Additional Settings -> Developer options -> Revoke USB Debugging Authorizations.

  2. Kill adb.exe in the taskmanager (CTRL + SHIFT + ESCAPE)

  3. Install again, watch for popups (accept RSA signature and install) Everything will work now

... ...

Solution 23 - Android

first, check your USB debussing options all mandatory should be enabled. then uninstall the application from the device and then try to reinstall again. this works for me.

Solution 24 - Android

Another possible reason in case if you have accidentally denied installing specific application - remove it from blacklisted.

It is under Security > Install via USB.

Note: You may not simply find it from Security. Instead search for "USB" from Settings search and look or that option in Security.

If your app is there - simply remove from the list. If not - then it's some other problem.

Solution 25 - Android

If it's still not working try adding android:exported="true" and upgrade your dependencies

Solution 26 - Android

For me only installing from Google drive worked.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbrainLoopView Question on Stackoverflow
Solution 1 - AndroidGladis WilsonView Answer on Stackoverflow
Solution 2 - AndroidAarif AslamView Answer on Stackoverflow
Solution 3 - AndroidPrashant AbdareView Answer on Stackoverflow
Solution 4 - AndroidShivani RastogiView Answer on Stackoverflow
Solution 5 - AndroidSportAtomDroidView Answer on Stackoverflow
Solution 6 - AndroidAjayView Answer on Stackoverflow
Solution 7 - AndroidSuryavel TRView Answer on Stackoverflow
Solution 8 - AndroidOwen AlikulaView Answer on Stackoverflow
Solution 9 - AndroidVladimir KrapotkinView Answer on Stackoverflow
Solution 10 - AndroidMd Imran ChoudhuryView Answer on Stackoverflow
Solution 11 - AndroidOsahadyView Answer on Stackoverflow
Solution 12 - AndroidPatrick PrakashView Answer on Stackoverflow
Solution 13 - AndroidPerryView Answer on Stackoverflow
Solution 14 - AndroidAyisha SadikhovaView Answer on Stackoverflow
Solution 15 - AndroidRahulView Answer on Stackoverflow
Solution 16 - AndroidmahendrenView Answer on Stackoverflow
Solution 17 - AndroidMithun C.NView Answer on Stackoverflow
Solution 18 - AndroidnbsView Answer on Stackoverflow
Solution 19 - AndroidShiva YadavView Answer on Stackoverflow
Solution 20 - AndroidxchiltonxView Answer on Stackoverflow
Solution 21 - AndroidSLyHuyView Answer on Stackoverflow
Solution 22 - AndroidJackView Answer on Stackoverflow
Solution 23 - AndroidZeeshan AkhtarView Answer on Stackoverflow
Solution 24 - AndroidАлександр БабичView Answer on Stackoverflow
Solution 25 - AndroidRohit LalwaniView Answer on Stackoverflow
Solution 26 - Androiduser3193413View Answer on Stackoverflow