15

I'm trying to do some app development for Android with Eclipse and my Nexus 5.

However, after the first time loading MyFirstApp from Eclipse, I can't seem to get the authorization right.

When I run adb devices from the command prompt, I end up getting

0350b965215d9854               unauthorized

or

0350b965215d9854               offline

and even after restarting everything, I only sporadically get the authorization popup on my phone. Even if I select 'always allow from this computer' checkbox (pic below), my computer remains unauthorized. I have never had it remember authorizing my computer as the checkbox would suggest.

A few times, after killing the server and restarting the server multiple times, adb will recognize the device, as after typing "adb devices", I get

0350b965215d9854            device

But if I try running the app in eclipse I'll get the following error message.

[2013-11-09 18:10:16 - MyFirstApp] Failed to install MyFirstApp.apk on device '0350b965215d9854': timeout
[2013-11-09 18:10:16 - MyFirstApp] Launch canceled!

I'm also unable to run shell or other commands from adb.

I've verified I'm using the latest usb drivers, android sdk, and eclipse release and have tried the following fixes:

On Nexus 5:

  • Booting in Safe mode

    Toggling/untoggling USB Debugging

    Revoking USB debugging authorization and reauthorizing

    Restarting the phone

    Allowing permissions on a one-time basis

On Windows 8:

  • Restarting the computer

    Restarting Eclipse

    Killing/starting adb from cmd

    Killing adb from task manager

    Reinstalling Eclipse

    Reinstalling google's USB drivers

    Installing the nexus 5 line in google's drivers as per this question

    Reinstalling the Android SDK

    Changing USB Ports

I've seen very similar posts for the Nexus 4 and Nexus 7, but after trying everything contained in those solutions, I'm still not getting anywhere.

Community
  • 1
  • 1
Jonathan McKay
  • 303
  • 1
  • 3
  • 9
  • 2
    I forget the setting name but the choice is Mass media or Camera. It shows up with you connect an android device to a PC. Try switching that to Camera and try again. – Randy Nov 10 '13 at 05:12
  • Its listed as a portable device under my computer, and the device manager, and I couldn't find any settings in the properties to force windows to recognize it one way or another. Are you thinking that there's a default windows driver possibly interfering with the adb server? – Jonathan McKay Nov 10 '13 at 05:28
  • It would be on the Nexus 5. Look at the notifications, do you see a "connected as" item? – Randy Nov 10 '13 at 05:57
  • Found it. Tried changing the USB connection to Camera (PTP), then back to Media Device (MTP), unfortunately the problem is the same as it was before. Thanks for the suggestion though! – Jonathan McKay Nov 10 '13 at 10:31
  • You tried a different port, but have you tried a different USB cable? Also it would be helpful to try a different computer. Not to say that it isn't a software problem, but it makes sense to rule out electrical unreliability. – Chris Stratton Nov 12 '13 at 15:50
  • I always had to keep the Nexus 7 in Camera (PTP) mode. – MBillau Nov 12 '13 at 19:34

7 Answers7

7
Here's my solution
1. I re-download the latest ADT bundle
2. uninstall the old driver in "My Computer" -> "Device Manager" (delete the old driver also)
3. Right click on "Nexus 5" and update the driver using the one under "[New ADT Path]/sdk/extra/google/usb_driver"
4. Turn on debug mode (click on KRT16M multi-times)
5. Deploy my first app . And a popup on device appears. Click "Yes" to accept the key.

Good luck!
Nevin Chen
  • 1,815
  • 16
  • 19
  • 1
    Thanks for the suggestion, but it didn't work for me. I think the problem may be in step 2, as I kept uninstalling the drivers, but upon restart sometimes they would reappear. – Jonathan McKay Nov 12 '13 at 22:20
  • Try this : in developer options. Find "Revoke USB debuggin authorization" and click it. Next time you deploy an APP. Watch carefully on the screen of your device which will ask you to accept a new key. – Nevin Chen Nov 13 '13 at 18:59
3

Have you tried updating both the SDK and ADT ? Support for Kitkat is provided in the latests ADT

inmyth
  • 8,880
  • 4
  • 47
  • 52
2


For me a tutorial provided by AndroidGeeks helped me fix the connection issues to my Windows (7) PC.

"Make sure to enable the USB Debugging for your Google Nexus 5 from the Developer Options first.

  • Open Settings, then About Phone.
  • Tap the Build Number seven times to unlock Developer Options.

Now you can continue to the tutorial. How to install Google Nexus 5 USB / ADB / Fasboot / Bootloader drivers:

  • Download the Nexus 5 Drivers from here.
  • Extract the zip contents and place all files in a single folder on your desktop.
  • Connect your device to your computer.
  • Launch the Device Manager on your PC.
  • Now you should see the Nexus 5 listed in the hardware list.
  • Right-click the ‘Nexus 5′ line and then click on Update Driver Software.
  • Next, click the ‘browse my computer’ option.
  • In the new window click on ‘Browse…’ button.
  • Go to folder unzipped at step 2. Select the folder where you extract the USB Drivers. Click Next. - make sure to tick the subfolder box too.
  • Now, the Windows installer will search for Nexus 5 drivers, click Install when asked for permission.
  • Wait for the process to complete and then check the Device Manager list to confirm that the installation was successful.

Also, you should launch the device in Bootloader Mode to check and see if the device is connected by your computer. If not, then you should stay in Bootloader Mode menu and then repeat the entire tutorial listed above. Eventually, the Google Nexus 5 will be recognized by your PC."

Link: http://www.android.gs/download-and-install-google-nexus-5-usb-drivers-adb-fastboot/

AustrianDude
  • 226
  • 2
  • 16
  • Please, don't put "Only link answers". Sum up a bit the content of the link :D (think that maybe in the future that link could be broken) – Pigueiras Nov 25 '13 at 20:14
1

After implementing Nevin Chen's steps above without success, I ended up upgrading my system to Windows 8.1 for unrelated reasons. Out of curiosity I tried usb debugging again, and it worked the first time without problems. It has continued to work since.

I can only suspect that the problem was a system setting that was installed with an incorrect driver that only a system restore or upgrade would end up rewriting. Trying to uninstall the drivers from the device manager seemed not to help the problem.

I would be curious to know if anybody else has solved this problem with a system restore or upgrade.

Jonathan McKay
  • 303
  • 1
  • 3
  • 9
1

On Windows 7, I tried the instructions in the following link: https://developer.android.com/tools/extras/oem-usb.html#InstallingDriver

I didn't get anywhere after several attempts with restarts of both the computer & device, and I tried multiple USB ports. I also switched from Nova Launcher to the stock launcher with no signs of improvement.

In the end, I changed usb cables and it worked!

The first cable was from a Samsung Galaxy S4 and had a noise reduction choke that was not present on the stock Nexus 5 usb cable.

nswitzr
  • 26
  • 3
0

I am using a brand new window 8 laptop:

Following steps works for me:
1. Download the latest ADT bundle
2.connect my nexus 5 to pc (it recognize the device after installing the default usb driver)
3 From Device Manager Right click on "Nexus 5" and update the driver using the one under "[New ADT Path]/sdk/extra/google/usb_driver"
4.Turn on debug mode (click on KRT16M multi-times)

works like a charm!

Sharif
  • 1,488
  • 17
  • 21
0

enter link description hereif you are using windows 7 and earlier, Adb installer works well. you just have to install the app and when u plug in your smartphone, it will recognize the build and get you what you need.

works well

tenzin
  • 1