Reputation: 4180
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
NOTE: while turning on install via USB a pop up saying The device is temporarily restricted
Upvotes: 404
Views: 523166
Reputation: 151
I accidentally clicked on "Deny" and also "Remember my choice". None of the above fixed my issue on MIUI 14. What I did to fix it was clear the data of "Security" app. Android asked for the permission again and app installed successfully.
Upvotes: 2
Reputation: 14328
here is :
Xiaomi 8
: MIUI 12.5.2
, Android 10
Developer Mode
, USB Debugging
Install via USB
, (has login Xiaomi Account) but popup: Please insert SIM card
then error:
➜ apk adb install xxx.apk
Performing Streamed Install
adb: failed to install xxx.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
Solution:
MIUI Optimization
Upvotes: 1
Reputation: 680
My solution:
Profit!
Upvotes: 3
Reputation: 18493
I had the same problem using another device from China.
It turned out that I had to install the app manually the first time:
I had to copy the .apk file to the device and install it by selecting the .apk file in the device's file manager.
(Installing apps from "third party sources" had to be enabled, of course.)
Once the app was installed, I could debug the app and AndroidStudio was able to update the installed app when I modified and re-compiled it (so it was not necessary to manually copy the .apk file again after modifying it).
Upvotes: 1
Reputation: 618
Check your minSdkVersion under app/build.gradle. Maybe your phone is old.
Upvotes: 0
Reputation: 41
if none of these solution works above then got to App>Permissions>Install via USB> here you see you app name with toggle btn ,just off the toggle
Upvotes: 2
Reputation: 727
For MIUI global 13 and above to turn off MIUI optimization
Upvotes: 49
Reputation: 9248
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"
MTP(Media Transfer Protocol) is the default mode.
Works even in MTP in some cases
Set USB Configuration to Charging
Upvotes: 897
Reputation: 2031
It's simple, in MIUI 9.x you need developer settings ON and then
(Debugging section)
Then in Android select Runb app and choose your Xiaome phone
EDIT: you will also need allow installation from unknown sources
Upvotes: 2
Reputation: 79
If you are still facing INSTALL_FAILED_USER_RESTRICTED issue try this this methods works for me in miui 13 Setting->Permissions->Install via USB->untick your app
Upvotes: 2
Reputation: 458
For MIUI 12:
This worked for me but got an android security warning.
Upvotes: 22
Reputation: 8636
MIUI optimization
from Developer options
next installs of this apk(and its updates) wont give this error anymore.
Upvotes: 7
Reputation: 579
If it's still not working try adding android:exported="true" and upgrade your dependencies
Upvotes: 2
Reputation: 615
Updated MIUI 12:
I have to turn on "OEM unlocking" beside other settings. (I don't need to change "Mi Unlock status"
Upvotes: 2
Reputation: 521
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.
Upvotes: 0
Reputation: 449
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]
Upvotes: 7
Reputation: 130
Upvotes: 1
Reputation: 319
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 -
Leave the following,
Upvotes: 2
Reputation: 975
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
Upvotes: 19
Reputation: 1123
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.
Upvotes: 74
Reputation: 389
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!
Upvotes: 18
Reputation: 151
Xiaomi MIUI.
Options - Permissions - Install via USB (not the same item in Developers options!) then uncheck your disabled app
Upvotes: 15
Reputation: 29
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
Upvotes: 2
Reputation: 1575
what worked for me
goto Settings -> Additional Settings -> Developer options -> Revoke USB Debugging Authorizations.
Kill adb.exe in the taskmanager (CTRL + SHIFT + ESCAPE)
Install again, watch for popups (accept RSA signature and install) Everything will work now
Upvotes: 0
Reputation: 9997
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.
Upvotes: 5
Reputation: 760
For me none of the above solutions worked. Instead i do following steps that solved the issue :
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.
Upvotes: 22
Reputation: 21
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
Upvotes: 2
Reputation: 3796
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
Upvotes: 41
Reputation: 2455
In your mobile device,make sure you have enabled the following buttons.
Settings > Additional Settings > Developer options
Upvotes: 106