Unable to install android app via usb debugging
Asked Answered
A

12

21

I know this is an old question but I am trying to install my app the very first time on Redmi note 4. Whenever i try to install it displays a dialog saying..

Installation failed with message Failed to establish session. 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! And it gives error after this.

This app is not installed before,I have cleared cache,rebuild the project,restarted my phone but nothing is working.

Actress answered 6/3, 2017 at 12:45 Comment(5)
Turn on USB debugging and Install via USB option from the Developer Options then try.Kobi
also look for some dialog in your phone alsoPip
check the enable install from unknown sourcesMonk
I have tried all the things mentioned aboveActress
Try click on Revoke USB debugging Authorisations......Civilized
D
62

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

Dacosta answered 6/3, 2017 at 22:21 Comment(1)
By the way, in case folks can't find the MIUI optimization option, it may be hidden, and can be found again via these instructions. tldr: click "developer options" > "reset to default values" a few times.Laryngeal
I
14

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..

Isley answered 25/3, 2017 at 4:37 Comment(0)
T
10

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.

Therontheropod answered 6/5, 2017 at 11:49 Comment(1)
By turning off MIUI Optimizations the dialog which was presented when I wanted to install app on phone was not shown (Xiaomi Mi 10 5G MIUI 12.0.3) . Issue was that in case phone screen got turned off, dialog will be dismissed after few seconds and to install an app will need to run install command again. This eliminates unneeded dialog confirmation.Malaspina
D
6

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.

Dodie answered 14/7, 2017 at 3:39 Comment(0)
R
1

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.

have so much pain looking for this way. just scroll down to bottom and you will find it.

Roumell answered 1/4, 2018 at 10:54 Comment(0)
E
0

The latest version of Android OS will have multiple user logins like admin and guest, whenever we install an app through USB debugging, that .apk file will be installed for all users in the mobile, Uninstall the .apk file from all the users including guest login.

Extemporize answered 6/3, 2017 at 12:52 Comment(2)
please also mention how to uninstall from all the users including guest login.Pip
I haven't installed it before so there is no point of uninstalling it.Actress
B
0

This issue occurs sometime I have also faced the same issue.

Try the following steps

Go to Settings > Additional settings > Developer Options

Off your Developer Option and re-On it

On - USB debugging

and press Revoke USB debugging authorization

I hope it will work.

Bewhiskered answered 6/3, 2017 at 13:0 Comment(0)
C
0
  • Turn off Developer Option
  • Restart your mobile
  • Turn on Developer Option
  • Turn on Usb debugging

Worked for me. Hope it works for others...

Constringent answered 17/3, 2017 at 10:31 Comment(0)
C
0

In my case Faced the Same Issue with My Redmi 3s PRIME and I can't able to enable the Install Via USB and it asks to connect Network So I tried the Following Method and luckily it works...!!

  1. Open Inbuilt Securit App.

  2. Click On Optimize. (While Scanning, It Disables the Developer Option )

  3. Now Open Settings->About Phone-> Tap On MIUI Version to Enable the Developer Option

  4. Open Additional Settings -> Developer Options.

  5. Now Re-enable the USB Debugging it automatically enables the Install Via USB

  6. In Android Studio Disable Instant Run Settings>Build, Execution, Deployment>Instant Run

  7. Now Run the App with Android Studio.

Concettaconcettina answered 16/8, 2017 at 10:47 Comment(4)
wish did work, but didnt for me.... sure it did disabled developer options, but re-enable, enable usb debugging did not enabled install via usb options too...TLunetta
Redmi note 4X and 7.0 @RAJESHLunetta
Have You Tried setting-> Additional Settings ->Developer options ->Turn Off MIUI Optimizations @uzuConcettaconcettina
i solved by inserting my usim, enabling, and then removing the sim cardLunetta
S
0

I had a similar issue. Manifest file had an option:

 <meta-data
        android:name="com.google.android.actions" />

which was causing the issue. I removed it and everything started working fine.

Scissel answered 2/7, 2020 at 5:42 Comment(0)
T
0

you can also check the build gradle, the minSDKVersion should match with your physical device

Turnheim answered 29/12, 2020 at 0:26 Comment(0)
C
-2

Just turn on 'Install Via Usb' switch at the bottom of 'USB Debugging' in Developer Settings

Cataphoresis answered 7/6, 2023 at 12:47 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.