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...
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.
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.
Related
I've mentioned the following permission:
<uses-permission android:name="android.permission.NFC" />
in my manifest.xml. But NFC code is no more in use and I commented the source code. Means NFC is no more in use for my app, but while installing the app, it's still shows in installing window.
So, is it possible in android that don't ask for permissions mentioned in Manifest.xml file, if code is not in use? Thanks
No, it is not possible, because the Android system has no idea which permissions your application requires before run-time. Picture the following scenario:
You are writing an application, not specifying NFC permission as you're not using it in your code, but you ARE using a framework that in 50% of the implementations do use NFC (device manufacturer specific framework).
The Android system has no way of telling if the NFC permission is required and thus it relies on your explicit instruction for permissions
As I'm sure you've noticed, an exception will be raised if the permission does not exist for the specified action
The only way to make sure the requirement is gone is to remove the permission from the manifest (and frankly, is it that much of a deal?)
Besides commenting out the unnecessary codes, you have to remove the permission from your manifest as well.
My app uses WebView. As of L-preview, there is a new feature filter introduced:
FEATURE_WEBVIEW. Declares that your app must only be installed on devices that fully implement the android.webkit.* APIs. Example:
<uses-feature android:name="android.software.webview" android:required="true" />
Source: http://developer.android.com/preview/api-overview.html#Manifest
I would like to understand the impact and the reason of this feature filter.
Which devices won't implement full android.webkit.* API?
If I add this line into my AndroidManifest.xml, I expect my app will still be available for Android 2.3-4.4. Is that true?
Which devices won't implement full android.webkit.* API?
Android Wear, and perhaps others.
If I add this line into my AndroidManifest.xml, I expect my app will still be available for Android 2.3-4.4. Is that true?
It should be.
I have added the following line into the manifest file but Play Store still shows Microphone in the features and it also says "XX devices removed" for the new APK file. (because of the microphone requirement)
<uses-feature android:name="android.hardware.MICROPHONE" android:required="false"/>
What can be the problem?
You still are requesting that you are using the feature but saying the device does not need the feature to use the app.
therefore the feature will show up because you still use it even though you dont require it.
If you dont want it to show then dont use the microphone
Most likely this is because you're using android.hardware.MICROPHONE instead of android.hardware.microphone. Hardware features are all lowercase.
Since it's not finding a matching <uses-feature> tag, it uses the implicit feature from the RECORD_AUDIO permission.
This is my problem:
I have an application that requires a certain persmission (Write-SMS) that will of course only function on phones. Now, the app requires that permission for a feature that will be disabled on tablet versions but it won't let users install the app on tablets.
I guess my question is this:
Can I easily create a second manifest for the tablet version, that will be roughly the same as the phone version but without the persmission?
If I'm doing so, is there a way to check what manifest version is being used? I might want to add features to the tablet version that are tablet exclusive and vice versa.
All of course preferibly in one apk, that gets exported and signed once. Thanks for your help in advance!
Simple add:
<uses-feature android:name="android.hardware.telephony" android:required="false" />
To your manifest. The SMS permission automatically asks for a Telephony feature. Adding this tells android that even though you ask for this feature, you don't need it.
Be sure to add an if-else check to see if you can sens SMS from the device before doing so.
I think you must check it in the actual method itself, because permissions can be optional or compulsory, but that's it, not distinguishable for different devices..
Yesterday I released my app and realised that it is not available for my android 2.3.3 device. (Does not get listet in search results, and when I access the app page directly, android market tells me that it is not available for my device).
The lines of my manifest, which could be the issue (IMO) look like that:
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="8" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-feature android:name="android.hardware.camera.autofocus" />
The only thing I can think of which could make a difference is that I have no SIM card inserted on that phone- but I have Wifi access. (will try it with SIM card in the evening)
Any ideas?
Application requires autofocus camera unless you add `android:required="false" to the use-feature tag.
From documentation, see last if statement:
Filtering based on explicitly declared features
An explicitly declared feature is one that your application declares in a element. The feature declaration can include an android:required=["true" | "false"] attribute (if you are compiling against API level 5 or higher), which lets you specify whether the application absolutely requires the feature and cannot function properly without it ("true"), or whether the application prefers to use the feature if available, but is designed to run without it ("false").
Android Market handles explicitly declared features in this way:
If a feature is explicitly declared as being required, Android Market adds the feature to the list of required features for the application. It then filters the application from users on devices that do not provide that feature. For example:
<uses-feature android:name="android.hardware.camera" android:required="true" />
If a feature is explicitly declared as not being required, Android Market does not add the feature to the list of required features. For that reason, an explicitly declared non-required feature is never considered when filtering the application. Even if the device does not provide the declared feature, Android Market will still consider the application compatible with the device and will show it to the user, unless other filtering rules apply. For example:
<uses-feature android:name="android.hardware.camera" android:required="false" />
If a feature is explicitly declared, but without an android:required attribute, Android Market assumes that the feature is required and sets up filtering on it.
The minSdkVersion="7" and targetSdkVersion="8" but you device is 2.3.3 which equal sdk version 10
This will help you to know the sdk versions
so change the versions range in your manafist file
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="7" android:maxSdkVersion="10" />