Android app installation: Unknown failure (Failure - not installed for 0)
Only Turning on "Install via USB" in Developer options did the work for me. Otherwise you may need to turn off MIUI Optimization and reboot again, but try the USB option first.
Problem is in Instant Run
.
As Chirag Shah said - on Xiaomi devices you can disable MIU optimization - it worked for me too when I tried.
Another solution is to disable Instant Run
in android studio settings.
I've remembered - I had this problem some time ago on windows, but now it occured on linux(ubuntu). I've wrote bug report to google, but problem is still here (first time it was Android studio 2.2.3 and now it is 2.3).
For convenience: To disable Instant Run go to
File->Settings->Build, Execution, Deployment->Instant Run
I solved my problem by following the steps bellow
- Turn off Developer options.
- Turn on Developer options again.
- Turn on USB debugging
- Turn on Install via USB
After following the steps I run from android studio and it was installed my app successfully.
For Redmi and Mi devices turn off MIUI Optimization and reboot your phone.
Settings > Developer Options > MIUI Optimization