title: INSTALL_FAILED_USER_RESTRICTED : android studio using redmi 4 device
body: <p><a href="https://i.stack.imgur.com/TsZ3Z.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/TsZ3Z.jpg" alt="Android Studio with Failed Error" /></a></p>
  <p>Got this freaky error</p>
  <pre><code>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?
  </code></pre>
  <p>When trying to run the <code>apk</code> in my redmi 4 <code>MIUI 8.5.4.0</code></p>
  <p>OEM unlocking enabled</p>
  <p>Solution Tried</p>
  <ul>
  <li>MIUI optimization turned off</li>
  <li>USB debugging turned on</li>
  <li>Verify apps over USB turned on</li>
  </ul>
  <p>NOTE: while turning on <strong>install via USB</strong> a pop up saying <strong>The device is temporarily restricted</strong></p>