I cannot launch app from Android Studio. When i click "run", I select my device:
And it appears an the following message:
But it is not true, the app is not installed in the device. In the "run" console, appears the following:
04/22 15:53:08: Launching app
$ adb install-multiple -r C:\Users\User\AndroidStudioProjects\some.apk
$ adb shell pm uninstall com.package.app
Unknown failure (Failure - not installed for 0)
Error while Installing APK
I have activated USB debugging in the device.
Try TURN OFF "MIUI Optimization" from developer options.
I've updated to MIUI 8.2 and encountered same problem, found the solution here and it works. Good luck!
http://c.mi.com/thread-171377-1-0.html
[Off-Topic] [Device Team] Fix For Unable to Debug Android App From Android Studio
#Fisherman's answer haven't worked for me.
I needed also to uncheck Verify apps over USB and it worked like a charm.
Related
I'm struggling with an issue connecting Android Studio to my Google Pixel 2.
When I plug my phone into my laptop, Android Studio now recognizes the physical device and shows 'Google Pixel 2' in the dropdown of devices to run the app on. When I go to run the app, it compiles without error but when it tries to install the app on my phone the connection between my phone and AS is lost (the device is no longer listed in the dropdown) and this error message is shown in the Run dialog:
06/12 17:08:35: Launching 'app' on Google Pixel 2.
Installation did not succeed.
The application could not be installed.
List of apks:
[0] '/home/kirk/Apps/xxxx/android/app/build/outputs/apk/debug/app-debug.apk'
Installation failed due to: 'device 'xxxxxxxx' not found'
Retry
Clicking the Retry link just results in it being launched in an emulator.
I've tried disconnecting and reconnecting the device, revoking the USB debugging authorisations then re-trusting my computer, as well as closing and re-opening Android Studio.
Any ideas?
Android Studio–>Preferences–>Build,Execution,Deployment–>Debugger–>“Use libusb backend”, select false–>Apply–>Ok
Sometimes ADB just need a restart.
adb kill-server
adb start-server
In my case I had a plugin to connect via wifi, like:
Android WIFI ADB
Try to uninstall this type of plugin then clean Android Studio on Invalidate Caches / Restart...
This happened to me when I was sharing Wi-Fi from my PC to the phone.
When I disconnected my phone from my PC's Wi-Fi, everything worked.
It could be an issue with ADB rather than Android Studio
I think it is problem with adb not with android studio I tried updating adb it worked for me. Try once
In android studio 3.6.3
This error indicates when I click on the Run button to install the program on the emulator.
Installation did not succeed. The application could not be installed.
Installation failed due to: 'device offline'
After a lot of searching, I found out that the adb had a problem and the emulator was turned off incorrectly.
I entered these commands in the cmd and the above error was fixed.
adb kill-server
adb start-server
adb connect [192.168.162.101]:5555
adb devices
List of devices attached [192.168.162.101]:5555 device
NOTE
This IP is 192.168.162.101, which has an emulator itself. If you want to run the emulator manually, you must get your emulator IP and replace it with 192.168.162.101, otherwise it should automatically follow. Implement the first two commands of the emulator on the adb
I was using the emulator. I just close the Android Studio and then opened it again. The issue was resolved.
Disconnect your phone and connect again. This was worked for me.
Android ADB showing device not found error when trying to install Apk.
After installing few apk's it becomes slow and disconnects all of a sudden giving adb device not found error. Please help me with a solution.
File-> Settings -> Build, Execution, Deployment -> Instant Run
disable "Enable Instant Run to hot swap code/resource changes on deploy(default enable)
The information shared by you seems a bit generic, still you can try any of the following solutions.
Open command prompt as administrator and enter below commands:
"adb kill-server"
"adb start-server"
Install drivers for you phone if you're not testing on emulator.
Open android sdk manager and check/install "Google USB Driver" from extras folder.
I was using Windows 7 and my adb driver was not working tried everything even google driver was showing error when i updated driver that it is not compatible with 32 bit. I tried changing cables and commands but it was showing exclamation mark on ADB interfaces in other devices inside device manager. Adb devices was also not showing any devices. I installed universal adb driver and now it is working fine. Hope it helps.
Probably won't work and you already have tried it, but if no one of the previous answers help, sometimes it's usb cable's fault. Just try an other one to be sure.
I went to File-> Invalidate Cashes/Restart this fixed it for me
Application works fine on emulator, but I can't launch application on my device (Xiaomi Mi4). At first i seed dialog with such text:
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!
Do you want to uninstall the existing application?
But after I agree - i see in log this message:
Launching app
$ adb install-multiple -r <....>
$ adb shell pm uninstall com.example.app.debug
Unknown failure (Failure - not installed for 0)
Error while Installing APKs
I've rebooted device several times and plugged/unplugged it to computer, but nothing helped.
For Redmi and Mi devices turn off MIUI Optimization and reboot your phone.
Settings > Developer Options > MIUI Optimization
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
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.
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.
My device is running android Lollipop 5.1 with Developers Options enabled and USB Debugging option checked. When I hit the RUN button on Android Studio it shows the following in the event log:
Target device: qmobile-lt500-D5180B1R63091071
Installing APK: C:\Users\Umair\AndroidStudioProjects\MyApplication\app\build\outputs\apk\app-debug.apk
Uploading file to: /data/local/tmp/com.example.umair.myapplication
Installing com.example.umair.myapplication
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.umair.myapplication"
And then nothing happens. App doesn't install and open. When I click on Android Monitor, it shows events on logcat, my device name etc. confirming that it is properly connected.
Someone tell me where the problem is.
In your mobile check unknowns sources apk install on/off
And make sure in your device space is available
First uninstall app from your device if you've already installed it.
Then in your IDE do clean and rebuild,and try restarting the device and also restarting your IDE.
That should work as expected now