4

We're currently revising our application manifest to explicitly use the uses-feature attribute to declare all its dependencies on hardware and software APIs.

Since we expect the user to have mobile Internet, we set android.hardware.telephony to true, but now the app fails to install on the emulator. The error message is:

Failure [INSTALL_FAILED_MISSING_FEATURE]

There is no additional information, not even in the device logs, but I could figure out by trial and error that the telephony feature was causing it.

Since the emulator has support for telephony functionality (you can even simulate dispatching a call), why does this break? And even if it correctly reports that it doesn't support telephony, shouldn't it be obvious that uses-feature was meant to target real devices, not the emulator?

I'm actually quite confused about this attribute now in general, since its documentation seems to imply that it only affects filtering rules for Android Market. I can't see where it mentions that uses-feature has a direct impact of the installability of an app, which seems to go way beyond the merely declarational/informational nature the docs attribute to it.

Maybe it's not a good idea to use it after all? Our build server doesn't execute anymore, since installation to the emulator now always fails...

mxk
  • 43,056
  • 28
  • 105
  • 132
  • what is exactly the error message you have ? – Valentin Rocher Dec 06 '10 at 12:16
  • sorry, added the error message we're seeing. – mxk Dec 06 '10 at 13:54
  • That's weird, but do you really want to place this restriction? A user might have good wifi coverage and not opt for a monthly mobile bill. – Chris Stratton Dec 06 '10 at 15:18
  • well, that's a fair question, but the problem is that there is no way to define either-or-requirements, and the user certainly needs some form of Internet access to use our app. And we believed that requiring Wi-Fi would be more restrictive than requiring mobile data, since we do not target tablets, only smartphones. – mxk Dec 06 '10 at 16:10
  • I've seen this too, with the "wifi" feature. But this only fails on a 2.2 emulator (presumably as that's when this tag started to be enforced); prior platform versions work. Still, very annoying. – Christopher Orr Dec 07 '10 at 11:26
  • @Matthias do you need `android.hardware.telephony` or you just need to make a call from your app? – Marcin Orlowski Nov 12 '13 at 12:37

2 Answers2

0

Basically what you need to use a more recent Emulater with more features supported,or alternatively you can do the following :

1.Comment out or remove the following lines from your Manifest XML file

<!-- COMMENT ME  -->
<uses-feature android:name="android.hardware.telephony" /> 

OR

2.Add the following :

<!-- UNCOMMENT ME  and add android:required="false"  -->
 <uses-feature android:name="android.hardware.telephony" android:required="false"/> 

You should be good to go if you do it correctly.

See Sample

Fred Ondieki
  • 2,314
  • 25
  • 23
-1

I have an app that uses telephony and works fine with the 2.2 emulator and I presume you have already set the required attribute to false in your manifest:

<uses-feature android:name="android.hardware.telephony" android:required="false"/>

If that's the case, my guess is that there is another feature or permission declared in your manifest that isn't present in the emulator and causing the error. Hunt it down through trial and error.

Jerry Brady
  • 3,050
  • 24
  • 30
  • I don't quite understand--if the app requires telephony, shouldn't that feature be set to `true`? The problem, as I see, is really that while the emulator does support telephony, it reports to Android that it doesn't. – mxk May 07 '11 at 10:29
  • required defaults to true. if you declare use of a feature that is required and the device doesn't support it, you won't be able to install and/or you will get filtered in the market. I've had to handle the emulator as a special case in my apps when dealing with TelephonyManager. – Jerry Brady May 12 '11 at 20:24