Unable to install android app via usb debugging

How to disabling Miui Optimizations

This issue was happening on my phone which is Xiaomi Phones running on Miui 8. After turning off Miui Optimizations on Developer Settings, restarting the phone a recompiling the application it worked.

for more detail: android gradle:2.3.0 install apk fail


I'm Using Redmi Note 4 mobile (Xiaomi Phone). I got the same problem.

Problem Resolved:

Go to setting >> Additional settings >> Developer options >>Turning off MIUI Optimizations 

and also turn on USB debugging and install via USB. And then restart your phone. After that, I am sure that your problem will be solved.


I didn't have to turn off MIUI optimizations (using MIUI v8.5.3.0 MAGCNED). In my case I was blocked by the MIUI security system.

Go to Settings > Additional settings > Developer Options

  1. Turn ON USB Debugging
  2. Turn ON install via USB
  3. Turn OFF Verify apps over USB.

Once you do this MIUI will prompt you whether you want to install your app. You only need to accept permission once.

One strange issue I notice is that I cannot enable install via USB without sim card. However, Once it is enabled I am able to remove the sim.


Open

1.File 
2.Settings 
3.Build,Execution,Deployment
4.Instant Run  
5.Un-check (Enable Instant Run to hot swap code)

Its work for me..