INSTALL_FAILED_USER_RESTRICTED : android studio using redmi 4 device

293,218

Solution 1

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

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 3

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 4

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

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!

Share:
293,218

Related videos on Youtube

brainLoop
Author by

brainLoop

Updated on July 08, 2022

Comments

  • brainLoop
    brainLoop almost 2 years

    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

  • Gabriel Espinoza
    Gabriel Espinoza almost 6 years
    for those who can't enable "Install via USB", turn off your wifi, enable your celular data transfer and try again
  • Henning
    Henning almost 6 years
    This solution worked for me after I did these two steps beforehand: 1. Insert a SIM-Card. 2. Turn off Mock SD-Card optimization
  • Mr. Suryaa Jha
    Mr. Suryaa Jha almost 6 years
    It works But Set USB Configuration to MTP ( Media Transfer Protocol ) otherwise your Device will not be there in the Select Device to run menu
  • AnswerDroid
    AnswerDroid over 5 years
    Ensure that you've SIM card inserted. they don't work on wifi only.
  • akshay bhange
    akshay bhange over 5 years
    Is there any way to remove/bypass that confirmation msg every time I install app?
  • SportAtomDroid
    SportAtomDroid over 5 years
    Did you ask about point 4? I did not check it but I think it is MIUI extra security. I have not tried to change it.
  • m0skit0
    m0skit0 over 5 years
    * then enable the option "Install via USB"* But where is this option
  • Vicky Salunkhe
    Vicky Salunkhe over 5 years
    Install via USB option is present under developer options
  • Ricardo Dias Morais
    Ricardo Dias Morais about 5 years
    Works on Redmi Note 7, i only needed to turn of MIUI Optimization, if i do all of those steps, i can turn on the optimization again?
  • Cuong Vo
    Cuong Vo about 5 years
    This is actually work in-case for some reason the app is on the rejected-list.
  • ascripter
    ascripter almost 5 years
    This should rather be a comment than an answer
  • Ehsan Sajjad
    Ehsan Sajjad almost 5 years
    all worked except charging for last one, i set it to MTP to work
  • Bibaswann Bandyopadhyay
    Bibaswann Bandyopadhyay almost 5 years
    Step 1 is most important
  • Mehmet Katircioglu
    Mehmet Katircioglu almost 5 years
    you saved my day, thanks. I denied installing the app by mistake, and selected remember my choice.
  • Shivani Rastogi
    Shivani Rastogi almost 5 years
    Can you please mention what error you are getting from Google play?
  • Ajay Pandya
    Ajay Pandya almost 5 years
    INSTALL_FAILED_USER_RESTRICTED & my OS is MIUI 10 global ,device redmi 7s, app play.google.com/store/apps/…
  • CoolMind
    CoolMind over 4 years
    Thanks for Install via USB. Permission confirmation was not asked (Xiaomi Mi 8).
  • Mickäel A.
    Mickäel A. over 4 years
    LIFE SAVER! I did the same mistake and ticked the "Do not ask again" checkbox... Thanks.
  • mochadwi
    mochadwi over 4 years
    step 1, turn off MIUI optimization was enough to debug our apps. "install via usb" now requires Mi Account, which is I never create one :D
  • lunesco
    lunesco over 4 years
    For me, turning on "Install via USB" was enough :)
  • Billy
    Billy about 4 years
    Mi 9T Pro Just Turn on "USB Debugging" and "Install via USB"
  • Christian Blanco
    Christian Blanco about 4 years
    The first step and the restart of the device was enough. Thanks a lot.
  • Stephen Hosking
    Stephen Hosking almost 4 years
    New to Xiami, with Redmi 7A and Android 9.0. I already had Developer Options. USB Debugging and Install via USB enabled, as normal pre-requisites. Then when I tried to install with AndroidStudio I got the Xiami (?) message "INSTALL_FAILED_USER_RESTRICTED". As instructed by this answer I un-clicked "Turn on MIUI optimisation" (at the bottom of developer settings), but did NOT restart. My apk then installed and ran. Thankyou! CAVEAT: My device is already unlocked, as per @Shivani Rastogi's answer below. Maybe this was also necessary?
  • OhhhThatVarun
    OhhhThatVarun over 3 years
    This is not even a solution, this is a dirty and inefficient trick
  • Hamed Rahimvand
    Hamed Rahimvand almost 3 years
    Don't turn off MIUI optimization, instead check this stackoverflow.com/a/52328849/10085274 this works for me
  • Krishna Shetty
    Krishna Shetty over 2 years
    Settings->Additional Settings->Privacy->Unknown Sources -- was helpful
  • KHAN
    KHAN about 2 years
    If you denied the app installation by mistake for the first time, this is the way to go! Thanks.
  • CoolMind
    CoolMind about 2 years
    On Redmi Note 4(x) I had to create MI account on step 3.