I'm trying to deploy an Apache Cordova app to an android device that's plugged into the machine. However when attempting to deploy, I receive the following error:
Unable to deploy to Android device, no attached device was found. If you recently attached a device, you may need to wait a few seconds before it is recognized.
As far as I'm aware, I've enabled all of the developer settings I need in order to deploy to the device. I've tried unplugging and plugging it back in, waiting a few seconds but to no avail.
I've tried changing the connection modes (HTC Sync, Disk Drive ect) however that hasn't made a difference.
The android device I'm trying to deploy to is pretty old (v3.35.61.3), so I've even tried to deploying to a different android device running the latest version of android however the same issue occurs.
This leads me to believe that it's an issue with Visual Studio not picking up any connected android devices. Perhaps I'm missing an install package?
After smashing my head against a wall for a couple of hours, I managed to get this fixed.
I followed these instructions to install the SDKs for the target device.
There was still an issue where the abd devices command was still not showing up with any devices, I installed the Universal ABD driver which I found in this question and that worked for me.
EDIT
Some of you have found that the following can also fix the issue:
Turn on the Developer Options on the device.
Enable USB Debugging.
It might be worth trying this first, and if that doesn't work, try what I did.
I ran in to this problem and I was sure I had everything installed. After some thought I tried to deploy again, and in the developer options on the device I turned usb debugging off and then back on, this got me a prompt to remember my computer's fingerprint. After that everything worked.
I had this issue too (can't reply to the answer because my rep is too low) and I found out that when my phone updates, it turns USB Debugging off. It's worth the time to check.
I had the same issue on my S4. When I turned on the developer options the Enable USB Debugging was turned off. Once I turned that back on the issue was fixed.
First option : Enable USB DEBUGGING
Second option : Change your phone cable.
Related
I'm having trouble getting Processing 3.3.6 (x64) for Windows 10 to recognize my LG V20 android device.
At first, I was getting a NoClassDefFoundError when I tried to run a sketch, and the Android SDK updater had 2 suggested updates that I couldn't install due to more errors. My phone was not listed in Processing. The device was I've enabled USB debugging, and the connection works; I can transfer files fine.
After reading across the internet with little advice or success, I tried uninstalling all Android-related files on my computer, as well as any Processing-related files. I uninstalled Java, JRE and JDK. I then reinstalled them all:
Java 8u161 JDK and JRE
Processing 3.3.6
Android SDK (auto-installed by Processing)
It all installed without complaint, and everything seemed fine. However, Processing still can't find or recognize my device. I've also tried these exact steps on my laptop which has a mostly clean install of Windows 10 (apart from chrome and some bloatware) with the same results.
I also tried running something via Processing's emulator; I may have done this wrong, but this comes up with a "Lost connection with emulator while launching" error.
From this, it feels like it HAS to be an issue with the phone, since it's on multiple PCs. But it also HAS to be an issue with the PC, since it occurs on both a phone and an emulator. Frankly, I'm dumbfounded as to what the problem is.
I'm not really sure what else I can do or try; I haven't found my problem anywhere else, and tried the solutions to all similar problems with no success. Does anybody have any ideas?
EDIT: I fixed the problem. I tracked down the location of my adb.exe, and ran "adb devices" in cmd at that location. It listed one
device (mine), and said it was unauthorized. A prompt appeared on my
phone, and upon confirming it, the device was authorized.
first off all check is your device connected to sdk by running this command
sdk/platform-tools/adb devices
if your device name not found make sure that you have USB debug enabled
goto settings/developer settings/ allow USB debug mode
if you don't see this option search how to enable developer settings for your phone mine was like
goto settings/about/software info
and tap constantly on build-number for 7 times
I love Processing and I dreamed with the chance to use it for making Android apps, as the "Android Mode" promises. Both mentioned issues (no device connection + no emulator available) as well as the endless red Java error messages couldn't never be fixed. I tried everything regarding Android Studio & SDK parameters & component installation, as well as different PC plattforms without success. Trying to configure the SDK for matching Processing's requirements was also a waste of time. Nothing helped. People who got it, they neither know how it runs nor why it doesn't.
Forget Processing for Android, use & enjoy programming with MIT App Inventor, and really start running apps in one hour. Let's use Processing for its original purposes.
I am very new to Android development. I am trying to create and run an app from tutorial - https://developer.android.com/training/basics/firstapp/creating-project.html
But while running app it is showing me "No USB devices or running emulator detected" in Select deployment target dialog.
Background and what I tried:
I am using Lenovo K4 note Vibe.
Android version 5.1
I have enabled USB Debugging from my phone also checked "Enable OEM unlock"
I have selected USB "MTP" as connection mode when I connected my phone to machine.
I am using windows 7 and Android studio version 2.3.2
My device appears in "Device Manager" of my system i.e. It is installed properly.
When I connect my phone to my system it shows AutoPlay dialog, asking to run "Run Lenovo_suite.exe", I tried to see if my deice appears in Studio when I allow to run that app, but still no luck
I also tried by checking and unchecking "Enable ADB Integration" from Android studio, still no luck
I have already installed Android SDK for verion 5.1
I have also tried installing "Google USB driver".
I also tried connecting my device to all of my machine port
I am tried using Emulator, but it is really very slow on my machine, it takes around 2-3 hours just to boot. So, I am using my phone.
Your assistance in this matter is greatly appreciated
this problem just happen when your USB connection mode is not work in debug mode, Like:
File Transfer Or MIDI device
The Charging Only is Work in android 5 and above
GoodLuck
a addition to above answer i think if you try to debug it , you will get better result since android if had problem throw a error that says restart adb.exe ,
another thing whats your hardware config ?
and have you tried genymotion , i prefer it over android virtual device , working with a real device is better , but i prefer when to concentrate on monitor have device on it ;)
As per My experience many device not connect
So you need to try this Windows Software to detected your android phone
Install it on your windows system PDANET+
Thanks for your support guys. After 2 hours of struggle I found below:
When I connect my device to the machine, it shows me a AutoRun dialog to Run Lenovo_suite.exe(Which I mentioned in my question), but instead of auto running, I explored that newly created lenovo drive, which had 2-3 setup exe's(usb drivers and magicPlus), I installed both and restarted my machine. When I run MagicPlus software, it helped me to Authorize USB debugging with some kind of fingerprints. And now my device appeared in studio.
I'm (very) new to Android development, and am trying to test my app on my Nexus 5X. I've previously done it successfully, on the same 5X, with the same version of Android Studio on the same computer, so I'm not sure what's changed.
With the phone connected via USB to my laptop running Linux Mint (18.1), in the 'Select Deployment Target' screen in Android Studio (v2.3.1) under 'Connected Devices', I see a single entry:
00b9xxxxxxxxcb26 [null]
(that's a full ID, but I'm not sure how sensitive it is as a value, so am being conservative).
I'm sure previously here it said "Nexus 5X" or something similar.
If I try to deploy to that device it fails, with an error saying:
Session 'mobile': Error Installing APK
No message appears on the phone, which definitely has USB Debugging enabled.
There's nothing in the Android Monitor tab, and the Event Log just shows:
21:42 Executing tasks: [:mobile:assembleDebug]
21:42 Gradle build finished in 661ms
21:42 Session 'mobile': Error Installing APK
I've tried updating Android Studio (I was previously on 2.3, and the same happened), restarting the phone and Android Studio. The app runs successfully in a Nexus 5X emulator.
I can't think of any other useful information that might be relevant, except that I'm connected USB-C to USB-C, but I'm pretty sure that was how I connected the phone before, I can try USB-A to USB-C tomorrow, but don't have that cable available right now. Any other thoughts?
Possible solutions:
disable USB debugging and re-enable it again
check the cable - if it's not the cable, connect the phone directly to the computer, without using any hub or anything
stop adb deamon: adb kill-server, and then remove the .android directory in your home directory - this will remove the debug keys *
removing your debug keys and restarting adb should make appear a confirmation dialog on your android device when you connect it
Adding a new answer, because although Adam Szewera and A. Petrizza's answers helped get me there, neither of them quite includes the key problem.
That was that I'd changed the 'Use USB to...' option, which appears as a notification when you plug the phone in to a computer to 'Charge this device'. Changing it to 'Transfer files' immediately fixed the problem, and now I see "LGE Nexus 5X ..." in Android Studio, and can deploy to it as before.
Thanks both for your pointers which got me thinking straight :)
Plan A.
You need to make sure the cord that is plugged into the computer is used for data transfer and not just for charging your device!
Go to your phone's settings and make sure that the developer settings are turned on (my phone tends to turn this off randomly sometimes).
If all else fails try the good ole' phone off and back on again.
Plan B.
go to Run
Click on Edit Configurations
Select the project
find the Target Device section under the General tab on the Android Application page.
Android Studio no longer seems to be detecting when an app has installed on a target device and opened. It gets stuck on "Installing APK" and the progress bar is empty. There are no errors, the apk successfully installs and opens, it's just the IDE is still showing "Installing APK" and it does not automatically connect the debugger. I can manually connect the debugger using the "Attach debugger to Android process button", but this is not ideal.
Can anyone offer any suggestions for what's up and how to resolve it?
It turns out the problem wasn't with Android Studio, but with the device I was using for testing. I tried a different device and it behaved normally, progressing beyond "Installing APK" and stopping on breakpoints.
Somehow the "wait for debugger" setting in developer options on the problem device had switched to off. I switched this back on and now this device is behaving normally.
-Note that I had to choose an arbitrary debug app for the setting to become active. Once I'd set it on, I deselected the debug app and the setting remained on, as I left it. This was a HUAWEI P8 running android 6.0 API Level 23.
Recently, I was facing the same issue when I have updated My Device (MI A1) OS from Android Oreo(8.0) to Android Pie(9.0),
Solution: Go to the Settings > Developer options > Now click on > Revoke USB debugging authorisations.
It will disable/remove developer options from your device, Now restart your device once and then you just need to re-enable your developer options and that all you need to do, Enjoy Developing on Pie.
Hope this will help you as well.. :)
I found a solution that works for me. In Developer Options turn off "Monitor apps installed by ADB".
Just reboot your phone (:
It happens after update android version.
On my HTC One I unchecked “Verify apps over USB” in Settings -> Developer Options.
I had this same problem. I solved it by revoking USB Debugging Authorizations and then re-enabling USB Debugging on my chosen device(s).
Edit: Cleaning my project also helped with solving this problem.
for me it was something magic
I solve it by removing the USB from the Laptop and from mobile too(type-c cable) and
turning off the debugging mode and again turn it on
and then I connect it back to my Laptop and selected the same FILE TRANSFER MODE
then run the app and it get installed to my device and work as expected
Hope you will find Useful to
I have this problem recently on my Pixel 2 testing device, latest factory image with Android Studio 3.4, on windows 10.
I have tried all methods mentioned but none of them work. It cost me more than 6 hours to figure it out.
My problem is the USB driver, I am not using the "perfect" USB driver. My driver works in most scenarios and commands but not in every scenario.
You do not need Android Studio to dig into this problem, just using adb.
Please try if you can install apk from adb using following command:
adb install xxxx.apk
If it stuck at "performing streamed install" but never finish, this is the problem.
Please try push a big file(more than 5MB) to your device:
adb push xxxx.apk /storage/emulated/0
In my testing, it stuck at 13%, 16%, etc, but never go on. It seems cannot transfer large files. This is why the installation is pending in my case.
I update the driver to another one, and the problem is fixed. Hope it can solve your problem, too.
I had the exact same problem.
what's more, i can not adb shell and adb push files.
I am running an Ubuntu 18.04 VM and test on xiaomi phone 8,9.
The problem for me was the USB Compatibility setting for the VM was set to 2.0, it needs to be at least 3.0. To change the setting power down the VM and choose the "Edit virtual machine settings" in the VMPlayer startup menu. Then select the "USB Controller" device and change "USB Compatibility" to USB 3.0.
Hope this can help u!
It doesn't hurt to verify your USB port. In my case it was the faulty USB port which I had to switch to the mobo's one instead of the case port.
Restarting Android studio worked for me
I tried rebooting my phone and it worked.
When attach my mobile to my PC, the follow menu is showed. I Clicke on it.
In the next section, I had changed from "USB connection" to "Transfer files"
After that adb install works for me.
In my case, Second Space was created but not switched on. I had to delete the second space and everything worked just fine.
My settings are:
Usb debugging -> ON
Install via Usb -> ON
Verify over USB -> ON
Wait for debugger -> ON
Device: Redmi Note 5 Pro
I had this issue with an emulator on Linux. After trying pretty much every solution and suggestion on this page, what made it work for me was turning off Instant Run.
In my case i did not make sure that my android studio DSK manager was up to date with the android version that my device was operating on. So when running flutter doctor all seemed well, and i had the latest android version and all on android studio, but as mentioned it was not matching the version for my device i had connected.
Once i added the correct android version (in my case android 6.0) with SDK manager using android studio, it did not get stuck at installing apk.
My case was similar but for Android Version 10 required having the Verify bytecode of debuggable apps to off.
Final settings were:
USB debugging -> ON
Wait for debugger -> ON
Verify apps over USB -> ON
Verify bytecode of debuggable apps -> OFF
Device: Pixel XL
For me, the top answer "wait for debugger" was completely greyed out.
What worked for me was to look inside "Apps" and I noticed the app was uninstalled, but only for my current user. Clicking uninstall for all users unblocked the installation via Android Studio again.
Check following in your project
build-gradle plugin version in project level build.gradle file
gradle version in gradle-wrapper.properties file
buildToolsVersion
uninstalling the previous installed app worked for me
Turn off Verify apps over USB and Verify bytecode for debuggable apps (might not be available for all devices) in your Developer settings menu. The install time will decrease drastically.
I'm using Visual Studio Xamarin and the issue was caused by the missing CPU architecture. After checking them, the APK became installable via adb install ...
Just reboot your mobile . If not working try reboot your Android studio and mobile.
UPDATE:
It's fixed! It turns out there was a driver on the LG site that, once downloaded, fixed the issue.
I've tried using both folders, including the usb_driver directory, but none of these directories work. It always gives me the same issue. As seen below, the 'ADB Interface' driver is most likely my android driver.
I've looked at this response to a very similar question, but none of these answers seem like they will work. I have an LG G4 phone and windows 8 on a Dell laptop. I would like to try running my application on my phone instead of an emulator, except whenever I plug in my phone, with developer mode turned on, I cannot seem to find or use my device on Android Studio. I run the application and get to the dialog that asks me to choose the device on which to run the application, but my device still does not show up. I have updated several packages on the SDK manager and tried manually installing the driver that's supposed to be in /extras/google/usb_driver/, but nothing has worked. Has anyone here been able to get their application running on their device while using Windows 8?
Make sure that USB debugging mode inside developer option is turned ON. After that you should see a dialog in your mobile to allow that computer for Debugging purpose. You can check always allow if it is your own PC