Skip to main content

Can't deploy apk from eclipse in ubuntu 10.10

I've been making some apps for android for quite a while but I've only been using windows 7. Due to some reasons sometimes I'm forced to program in linux so I followed the guide to configure the SDK and eclipse (http://developer.android.com/guide/developing/device.html).

After that I ran "adb devices" and got this:

List of devices attached 
???????????? device

As you can see the name is unknown but this also happens in windows so I didn't fret too much over it.

Then I launched eclipse and made a very simple project to test the deployment but here two things happened:

1st- It doesn't detect the android SDK version. (http://img515.imageshack.us/img515/5611/escolha.jpg)

2nd- when I try to deploy I get the following output:

[2010-10-09 23:06:45 - testeAndroid] Android Launch!
[2010-10-09 23:06:45 - testeAndroid] adb is running normally.
[2010-10-09 23:06:45 - testeAndroid] Performing com.examples.teste.teste activity launch
[2010-10-09 23:06:45 - testeAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-10-09 23:09:50 - testeAndroid] WARNING: Unknown device API version!
[2010-10-09 23:09:50 - testeAndroid] Uploading testeAndroid.apk onto device '????????????'
[2010-10-09 23:09:50 - testeAndroid] Failed to upload testeAndroid.apk on device '????????????'
[2010-10-09 23:09:50 - testeAndroid] com.android.ddmlib.AdbCommandRejectedException: device not found
[2010-10-09 23:09:50 - testeAndroid] Launch canceled!

I'm using:

eclipse 3.5.2

adt 0.9.9

android SDK tools r7

android phone: vodafone 845 = Huawei U8120 - android 2.1-update1

Any idea for what is happening?

thanks in advance ;)

Solved

The Huawei U8120 (Vodafone 845) phone is one of those USB devices that present themselves as USB storage devices to the host operating system to serve up files for Windows driver installation. To switch them into the USB slave from Linux mode you need to use usb_modeswitch. You can download the latest usb_modeswitch package from the homepage, it includes support for your device. Or just use this call on the command line:

$ sudo usb_modeswitch -v 0x12d1 -p 0x1031 -s 20 -M "55534243123456780600000080000601000000000000000000000000000000"

However to use it with the Android tools you need to solve another problem, because the Huawei U8120 (Vodafone 845) provides no serial number. There might be other workarounds, but the one that made it work for me is a patch for the "adb" utility that can cope with devices that have no serial number.

$ ./tools/adb devices

List of devices attached

noserial-/dev/bus/usb/001/036 device

The patch is here: https://review.source.android.com/#change,13552 and here you can find an "adb" binary if you trust that source :) www.mediafire.com/?oizmyyw0wwz

see also http://code.google.com/p/android/issues/detail?id=4365


You have to update your udev rules according to the manual on http://developer.android.com/guide/developing/device.html - then it will work.


I have also android plataform and just a couple of days, an upgrade seemed to solve the problem. You have to make sudo usb_modeswitch -v 0x12d1 -p 0x1031 -s 20 -M "55534243123456780600000080000601000000000000000000000000000000" and the standard adb, as well the ADT plugin worked in ubuntu 10.04.

My adb version is 1.0.26 and the ADT plugin 10.0.0.v201102162101-104271, since the ADB upgrades forced me to update Eclipse plugin.


Comments