I have some strange problem with my app.
I create a new version of my app with minor update, also was updated some libraries so I get changes in permissions with only location permissions
Bad version
android.hardware.BLUETOOTH
android.hardware.FAKETOUCH
android.hardware.LOCATION
android.hardware.MICROPHONE
Good version
android.hardware.BLUETOOTH
android.hardware.FAKETOUCH
android.hardware.LOCATION
android.hardware.location.NETWORK
android.hardware.MICROPHONE
So I got problem what users who have installed good version can't see updates in market.
For example devices Samsung S4 mini, S7 Edge
Also I can simulate problem by these steps:
1. Install good version from APK
2. In market see only Delete and Open, but not update.
Good version - version code 1
Bad version - version code 2
How to fix? Or what problem is it?
These IDs are not permissions but features, which are also displayed in the Play Console. They may be explicitely declared in the manifest or deduced by the Play Store from the permissions.
If you declare an api level >= 21 and a location permission, you have to declare that you use the corresponding feature :
Caution: If your app targets Android 5.0 (API level 21) or higher, you
must declare that your app uses the android.hardware.location.network or android.hardware.location.gps
hardware feature in the manifest file, depending on whether your app
receives location updates from NETWORK_PROVIDER or from GPS_PROVIDER.
If your app receives location information from either of these
location provider sources, you need to declare that the app uses these
hardware features in your app manifest.
What happens if you explicitly add the android.hardware.location.NETWORK or android.hardware.location.gps feature to the manifest ? or if you lower the target level to 19 ?
Related
I have an Wear OS app on the Play Store. Recently I wanted to upload update but I'm getting error Your app currently targets API level 30 and must target at least API level 31 to ensure that it is built on the latest APIs optimised for security and performance. Change your app's target API level to at least 31.
I would understand this for regular phone app but in Play Console Help Center they clearly state that Wear OS app are excluded (since nothing newer than API 30 exists there anyway) - https://support.google.com/googleplay/android-developer/answer/11926878
This is the error:
I'm not sure how they define (distinguish) between regular app and Wear OS app because when I've created store listing it was basically regular app setup + enabling Wear OS form factor but all the documentation describe it this way. And the distribution was working fine so I consider my app listing Wear OS only.
I also have <uses-feature android:name="android.hardware.type.watch" /> in the manifest as required.
Tldr; is it something I'm missing in my setup to be eligible for this target API exception for Wear OS or is this console error happening to others as well?
Change Your targetSdkVersion to 31
then try to Upload on Play Consol
I'm building an Android application using Xamarin. Visual Studio allows you to specify the target and minimum SDK level for Android, and this seems to work correctly, as decompiling the APK shows these attributes on the manifest tag of AndroidManifest.xml:
platformBuildVersionCode="25" platformBuildVersionName="7.1.1"
Please not that this is not the manifest file in the project, but rather the manifest file bundled in the final application. The latter does not have uses-sdk values.
However, I don't seem to be getting the expected functionality at runtime for targeting this version. Specifically, the app never asks for runtime permissions (introduced in API 23 IIRC), and when you try to revoke a permission on the app, you get this message:
This app was designed for an older version of Android. Denying permission may cause it to no longer function as intended.
This has been noted on several devices running above API 23, including a Pixel, which should be running stock Android and have no issues with detecting SDK version.
How is Android deciding which SDK version I'm targeting if it's not using the manifest values? How can I ensure my app will have access to API 23 features at runtime?
I believe this information is encoded in the signature of the APK, as the minimum SDK version is a parameter given to apksigner:
--min-sdk-version Lowest API Level on which this APK's signatures will be
verified. By default, the value from AndroidManifest.xml
is used. The higher the value, the stronger security
parameters are used when signing.
I'm not 100% sure on this, but it seems like this is the only way Android could know without using the manifest directly, and it would explain why it was possible for the manifest value to not match the value seen at runtime.
Simply changing from android:targetSdkVersion="22" to "23" causes my app to crash on the Galaxy S6. What would cause that? Rolling back and everything is fine.
I don't have an S6 so I cannot replicate - I'm sure it is something simple...
The most likely cause is the permissions required by your app, specified in your Manifest.
"Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app."
See Requesting Permissions at Run Time
In particular if your app requires any of the permissions listed in the Dangerous permissions and permission groups table, you will need to implement code to ask for those permissions at runtime on devices running 23 or higher. If you don't, and you try to perform a task that requires one of these permissions, the app will crash.
Normal (Non-dangerous) permissions however, are automatically granted by the system if required, and do not need to be individually requested at run time.
If you want to avoid this issue, just leave your target SDK as 22.
If there are other features of SDK 23 that you particularly need then you will need to go through the steps indicated in the first link above so that permissions are requested at run time on devices running 23 or higher.
Marshmallow (23) has been rolled out for the Galaxy S6 in many regions now. If you can find out what Android version the Galaxy S6 that is experiencing the crash is running, I bet you'll find it's Marshmallow.
I just come to know newer tag in android manifest file called "uses-permission-sdk-23"
<uses-permission-sdk-23 android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.CAMERA" />
Can anybody please provide difference between this two?
Summary
<uses-permission> applies to all SDKs and <uses-permission-sdk-23> will apply the permission only to SDK 23+.
When should you use <uses-permission-sdk-23>?
For Android SDK 23 and above, you have the option to request the permission at runtime but the permissions will be in their default state upon installation and the user will not be prompted at installation. (Essentially this can be used to prompt the user to grant the permission on a need-to-use basis and you have the opportunity to provide an explanation of why it's needed.)
However, for SDK 22 and below, the user is prompted at installation for permissions. As some permissions can seem suspicious or dodgy to the user, you may not want to request these for SDK 22 and below as you can't provide an explaination of why you need them beforehand, hence the <uses-permission-sdk-23> tag.
Additionally: the documentation is unclear as to whether sdk-23 permissions also cause the app to be filtered in the Play Store, but if it was your intention to do this, the documentation recommends that you make use of <uses-feature> elements instead to declare hardware compatability.
Recommendation
Generally, it is considered best practice to use <uses-permission-sdk-23> if your app does not need to support SDK 22 and below, or if the permission you are requesting is not needed for SDK 22 or below as it is then clear that this permission is requested at runtime.
Otherwise, <uses-permission> should be used as this is backwards compatible and the behavior will be correct on any SDK version; 22 and below, permissions will be requested at installation. 23 and above, it's up to you to request at runtime.
You should request permissions at runtime wherever possible as it allows you to explain to your user why you need certain permissions rather than just prompting them with a list of permissions at install time when the user has likely not established trust in the app.
Notes
Both of these accept a maxSdkVersion attribute that can be used when a permission was required for older devices but is not required for newer devices. (For example, the WRITE_EXTERNAL_STORAGE example shown in the Android documentation.)
Reference: (Android Documentation)
if the app is running on a device with SDK version 23 or higher. If the device is running SDK version 22 or lower
when you update an app to include a new feature that requires an additional permission. If a user updates an app on a device that is running SDK version 22 or lower, the system prompts the user at install time to grant all new permissions that are declared in that update. If a new feature is minor enough, you may prefer to disable the feature altogether on those devices, so the user does not have to grant additional permissions to update the app. By using the uses-permission-sdk-23 element instead of uses-permission
you can request the permission only if the app is running on platforms that support the runtime permissions model, in which the user grants permissions to the app while it is running.
for More info refer this.uses - Permission sdk 23
By using the <uses-permission-sdk-23> element instead of <uses-permission>, you can request the permission only if the app is running on platforms that support the runtime permissions model, in which the user grants permissions to the app while it is running.
This has been introduced to support runtime permission feature of Marshmallow (API-23) onwards.
This simply specifies that an app wants a particular permission, but only if the app is running on a device with SDK version 23 or higher. If the device is running SDK version 22 or lower, the app does not have the specified permission.
This element is useful when you update an app to include a new feature that requires an additional permission. If a user updates an app on a device that is running SDK version 22 or lower, the system prompts the user at install time to grant all new permissions that are declared in that update.
You can reffer to the documentation.
user-permission-sdk-23 specifies that the app that wants a particular permission is running on SDK version 23 or higher.
It is used when you update your app to run SDK 23 elements and the users running a lower API which does not support the new elements.
Android manifest - user permissions
Specifies that an app wants a particular permission, but only if the app is running on a device with API level 23 or higher. If the device is running API level 22 or lower, the app does not have the specified permission.
see the documentation
uses permission
Use
<uses-permission-sdk23>
to apply permission for Marshmallow devices only.
I was getting ready for runtime permissions on android M when I recently figured out that (at least on theGgalaxy S6 of my friend), still all permissions have to be confirmed at installation time (Google Play).
He has Android M, and sure you can revoke the permissions in the app settings now, but initially when you start the app after install, everything is granted.
I am kind of surprised, that's not the "Runtime Permissions" I was expecting.
Any hints on that? Did I miss something?
According to the doc:
This lesson describes how you implement permissions requests on apps that target API level 23 or higher, and are running on a device that's running Android 6.0 (API level 23) or higher. If the device or the app's targetSdkVersion is 22 or lower, the
system prompts the user to grant all dangerous permissions when they
install or update the app.
The runtime permissions will only take effect if you update the target SDK to 23