I have been using android studio for the past 5 months and everything was fine. Suddenly, yesterday when i tried to debug my app android studio gave me the error of 'adb.exe start-server' failed -- run manually if necessary.
In an attempt to solve this, I
Killed adb.exe via task manager, restarted android studio and got the error
Opened command window,navigated to platform tools, adb kill-server and adb start-server, restarted android studio and still got error
Then,
I downloaded the latest platform-tools of version 28 something from the documentation.
Updated SDK tools from SDK managet to version 28.0.3
Updated Android emulator to a version of 28
Tried to debug my app, got no 'adb.exe start-server failed' error but my device is not being detected by the android adb despite it is detected by my laptop
Then i started again the command window, restarted the adb server, then i checked the connected devices on the adb by typing 'adb devices' but no devices was shown in the list.( maybe the problem is something here)
I toggled among the usb options on my phone, still my device is not detected on android.
Can somebody help me on this please?
Note: My android device is on debugging mode and this is the same device i have been using since 5 months on android studio.
Install and configure your Android device:
Install the USB driver for your Android device.
Enable USB debugging on your Android device.
If necessary, install the Android development tools (JDK/SDK/NDK).
These libraries are installed by default by the RAD Studio installer.
Add your Android SDK to the RAD Studio SDK Manager.
Connect your Android device to your development system using the USB
cable provided with your device.
At the AutoPlay prompt, select Open device to view files.
In the Control Panel, search for and select "update device drivers".
In the system Device Manager:
Your Android device should be listed under Portable Devices. Locate
and right-click your Android device, and select Update Software
Driver.
Browse to the \extras folder in your installed directory, and
select the folder that matches your Android device. Then click OK.
For example, select google for the Nexus 7 or Nexus 10 tablet.
If you do not find a folder for your Android device, see Installing the USB Driver for Your Android Device.
Verify that your Android device is now:
Listed in Windows Explorer, below the system disk drives, along with your mapped network drives.
Displayed in the Target node in the Project Manager.
Related
I'm trying to debug a NativeActivity C++ Android application from Visual Studio 2019, using the Visual Studio Android tools.
My system uses Windows 10 Pro, with Hyper-V enabled, running a number of other Hyper-V images (this cannot be turned off for reasons,) but the development Windows install is the "main" (host) OS.
I can build the sample application, and I can attempt to connect it to the VisualStudio_android-25_arm_phone AVD. However, one of two things happen:
If I just run out of Visual Studio, I get the error:
Severity Code Description Project File Line Suppression State
Error Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device. XMCRemote3.Packaging 0
If I start the appropriate x86 AVD inside the AVD manager, the device actually starts up. If I then try to run in Visual Studio, I get an error dialog from the AVD Manager that the device and the host have different versions of ADB.
Device error: adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
adb.exe: device offline
This is the Visual Studio log when that happens:
1>Failed to start emulator.
1>emulator: Requested console port 5556: Inferring adb port 5557.
1>emulator: ERROR: x86 emulation currently requires hardware acceleration!
1>Please ensure Intel HAXM is properly installed and usable.
1>CPU acceleration status: Android Emulator requires an Intel processor with VT-x and NX support. Your CPU: 'AuthenticAMD'
1>Error installing the package. The device 'VisualStudio_android-25_x86_phone' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device.
1>The device is invalid or is not running.
I don't think I have the "x86 device doesn't work on AMD" problem, as I'm using Hyper-V, and the device starts up and is interactive when I launch it manually.
Sometimes, I think I might have a "ADB port number" issue, because the error message in the log sometimes talks about ports 5556 and 5557, and sometimes about 5553 and 5554. However, I wouldn't know at all where that's coming from, or what to do with it.
And, like in case 2 above, sometimes it just claims ADB is mis-matched.
What can I do about this? Do I need to update the device image, or the local tools? Both were very recently downloaded/installed.
I'm targeting SDK version 21 for both minimum and target versions.
The SDK Tools version is 30.0.4, and the emulator is 30.1.5.
The Platforms installed are 8.0/26 and 7.1/25 (the list only goes up to 8.1/27)
Interestingly, there's no "NDK" version listed in the SDKs and Tools android settings app, even though Visual Studio compiles and links it just fine.
I wonder if the Visual Studio package is installing something on the side? If so, is there another tool to manage what this is than the "Android" sub-menu in the Visual Studio "Tools" menu?
Uber goal: debug/deploy react-native android application on Windows machine
Problem: When deploying to the emulator react-native run-android fails with > com.android.builder.testing.api.DeviceException: No connected devices!. I tried running adb devices, but that returned no devices. My assumption is that to get this working I need to at least make adb aware of the emulator, and so here I am.
Versions
Windows 10
Version 1703 (OS Build 15063.540)
abd
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
Visual Studio Emulator for Android 1.1.622.2
Android OS hosted by emulator KitKat (4.4) API Level 19
Emulated Device 5" screen XXDPI Phone "Similar to Samsung Galaxy S5, Sony"
Setup
Android OS:
Enabled developer mode
Turned on USB Debugging
VM:
2 GBs memory
2 virtual processors
1 Windows Phone Emulator External Virtual Switch
1 Windows Phone Emulator Internal Virtual Switch
Result
adb devices returns that it can't find devices followed by two blank lines:
List of devices attached
<blank line>
<blank line>
What has already been tried/verified
Verified emulator boots
Verified emulator has a network connection and IP address (I can reach internet from emulated android)
Verified I can ping said IP address from the host Win 10 machine
Verified I can find (via adb devices) and deploy (via react-native run-android) to real device attached by USB
Tried forcing adb connection with adb connect 192.168.0.2:5555 and adb connect 192.168.0.2:5554 and received following error:
unable to connect to 192.168.0.2:5555: cannot connect to 192.168.0.2:5555: No connection could be made because the target machine actively refused it. (10061)
Couldn't find remedy for this online
Request for Help
If anyone knows what might be going on and can provide some guidance to resolve, I'd greatly appreciate it. If you need any additional information just ask, and I'll provide it (helpful hints on how to gather it, if non-obvious, would also be appreciated).
Thanks so much for reading this far :)
I was facing similar issue and in my case the setup was like following
Versions
Windows 10 pro Version 1803 (OS Build 17134.165)
Visual Studio Emulator for Android Android
OS hosted by
emulator Marshmallow (6.0.0) (4.4) API Level 24 Emulated Device 5.7"
screen XXDPI Phone "Similar to Samsung Galaxy note4"
In my case I also installed Android Studio which I think it has contributed to the problem by installing SDK under my user folder
C:\Users\[name with space]\AppData\Local\Android\Sdk
Visual Studio also installed Sdk in program files
C:\Program Files (x86)\Android\android-sdk
I decided to move/install android-sdk in c:\Android to avoid issue
Android SDK location should not contain whitespace, as this cause problems with NDK tools
Solution
What I had to do was to consolidate all the Environment variables and Registry entries to point to the right folder
This Stackoverflow question/answer would help in setting registry
'Visual Studio Emulator for Android' devices are not listed in the Android Device Monitor
Then from within visual studio (Tools > Android > Android SDK Manager) open SDK Manager
Go to tools tap and make sure "Android SDK Location" is set to C:\Android\Sdk and also following items are checked
Then in environment variable make sure There is System Environment variable called ANDROID_HOME and the value should also be c:\android\sdk
In my case there was a ANDROID_HOME User Environment which was overriding the system one. Either get rid of that or change it to c:\android\sdk
Once you've updated all these registry and environment variables close all command prompt windows and open a new one (to have environment variables set correctly)
Then check android home by running following command
C:\>echo %ANDROID_HOME%
c:\android\sdk
Also echo %path% and it should have a path pointing to c:\android\sdk\platform-tools and no other paths
Then run adb --version and make sure it is running as c:\android\
and then run
adb kill-server
adb start-server
Once you have done that lunch Visual Studio for Android and run your image of choice. Then adb devices should return the emulator IP address
Extra Resources
There is a good documentation for general troubleshooting the Visual Studio for Android which you can follow for initial troubleshooting:
https://msdn.microsoft.com/en-us/library/mt228282.aspx
I've followed the instructions at google: https://developer.chrome.com/devtools/docs/remote-debugging. I've also went over the troubleshooting section - but nothing seems to work.
I have samsung galaxy 3 (android 4.1.2, chrome 42.0.2311.111). USB debugging enabled. I've tried restarting the device after ticking the USB debugging a few times.
On windows 8 I run chrome (44.0.2388.0 canary). I've installed Samsung USB Driver, and my computer can see my device.
I do not get any notification when plugging the device nor when opening canary with the inspect page.
Did I miss anything?
Try these steps:
Download and install Android SDK
Open SDK Manager.exe
Select Android SDK Platform-tools and press Install packages...
Open a command prompt and execute these commands:
cd C:\Program Files(x86)\Android\android-sdk\platform-tools (or C:\Users\User\AppData\Local\Android\Sdk\platform-tools)
adb.exe devices
You should receive a response like this:
List of devices attached
ABCDEFG123 device
If your device is listed check if Chrome detect the device, otherwise try to execute this command:
adb.exe kill-server
adb.exe start-server
adb.exe devices
Check again if Chrome detect the device.
If your device is not listed at all after executing adb devices command there is something wrong in your configuration (e.g. incorrect or missing drivers?)
Hope this helps somebody else...
This happened to me because I was trying to Chrome inspect a release build (Ionic; i.e. ionic build android --release). If I build a debug app (ionic build android), I am able to see the app from the chrome inspection tool without any issues.
Google play does not like debugable apps https://developer.android.com/studio/publish/index.html
which is needed for the inspection - see this SO link: debugging an ionic app for android platform hence proper releases won't appear in the Chrome inspection.
In my case the problem was solved changing the usb connection mode in the settings of the Android device to "Camera (PTP)" . For some reason the usb debbuging did not work when connection mode was set to MTP.
This looks like a bug in Chrome or in Android. This helped me: on your android device select USB connection settings (popup which is open on cable connect). It has MTP/PTP/charge modes. Switch between MTP/PTP and back.
Download and install Android SDK
Open SDK Manager.exe
Select Android SDK Platform-tools and press Install packages...
MTP -> PTP
I'm having issues running my Android application on a Motorola XT907 phone. I'm using Eclipse. USB debugging is enabled on the device, and I was able to get my application on two other phones, yet I'm having trouble with this one.
Eclipse is set up so that I have to select the device when I run the application.
In my manifest, minSdkVersion is 14, and targetSdkVersion is 19. The phone I'm using is running 4.4.2.
In the project properties, the Project Build Target is set to Android 4.4.2.
I'm running Windows 8.
Here is what I tried so far:
Rebooted the device.
Ran commands to restart adb. (adb kill-server, adb start-server)
Restarted Eclipse
Restarted my computer
Lastly, I have tried manually installing driver software, but I am unable to do this properly. This was my procedure:
Open Device Manager
Right click on XT907 under Portable Devices and select Update Driver Software...
Select Browse my computer for driver software
Select Let me pick from a list of device drivers on my computer
Select Have Disk...
Browse to adt-bundle-windows-x86_64-20140321/sdk/extras/google/usb_driver/android_winusb.inf and click Open, then OK
This is where I run into an issue. I get a dialog with the title "Select Device" that says "The folder you specified doesn't contain a compatible software driver for your device. If the folder contains a driver, make sure it is designed to work with Windows for x64-based systems."
Does anyone know how to solve this issue?
try this:
on your phone, activate usb debugging (and enable ADB);
connect the phone to the same network of your pc. connect USB too.
in your command prompt go to your adb.exe folder (.../sdk/platform-tools/) and execute adb connect (your mobile IP)
I use this on my Samsung nexus without drivers installed.
Did you try the driver from the motorola site of this phone :
https://motorola-global-portal.custhelp.com/app/answers/prod_answer_detail/a_id/89608/p/30,6720,8577
?
I searched trough many questions and couldn't find an answer that fix my problem.
I'm new on creating Android projects and I'm still getting familiarized with the eclipse platform.
To the point, when I run my project I get this error
No compatible targets were found. Do you wish to add new Android Virtual Device?
I changed the AndroidManifest.xml from targetSdkVersion="18" to "15" (Which is my device level, Android version 4.0.4, correct me if I'm wrong)
Then I clicked on Run Configuration and switched from "Launch on all compatible devices/AVD's" to "Always prompt to pick device", and still couldn't get the project to work.
When I reverted the Run Configuration I get this output everytime I try to run the project
[2013-12-15 21:27:28 - MyFirstApp] No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD.
What's the meaning of both messages? How can I make it work?
Some details:
Android Version: 4.0.4
OS: Windows XP
Samsung Galaxy S DUOS
Please follow the steps
Step 1
Check if the device driver is installed successfully. If not, download the drivers and plug the device again.
Try this link to download the driver software - http://samsung-kies.en.softonic.com/
Step 2
Click Start-> Run-> CMD. (Go to command prompt)
Navigate to the android SDK platform tools path.
Type adb devices
Now you should get the device listed and a tag "device" next to the device ID
Step 3
If you get "no devices found", type adb kill-server
Type adb start-server
Now type adb devices.
Now you are good to start testing your applications on device.
You have to have Samsung Kies installed on your computer so you can have drivers for your device, also, from eclipse:
window -> show view -> devices
if you don't see your device here, this means either your ADB is not running, or your device is not recognized by your computer
also verify you have debug mode enabled in your device
Do you have the usb debug driver for you device installed? This is the driver that allows your device to "comunicate"with eclipse in order to debug