Dealing with Android SDK versions and Targeting - android

So we are working with Xamarin and it seems that after we upgraded our Android project it seemed to change the Target SDK of our app from 21 to 25. We never noticed this and uploaded an .apk into Alpha Testing.
I later noticed this issue, tried to revert to v21 target and now Google is telling me it cannot because of a breaking permission change in v23 (Marshmallow).
I tried disabling the alpha testing and deleting the v25 target, but that did not work.
I did notice that I could at least downgrade to v23 Marshmallow and carry on with my app release.
BUT: According to usage stats I've looked into I'm cutting off support for appx 15 - 25% of devices (take your pick) by only supporting Marshmallow+...
I've done some research around the issue and haven't found a way to solve it yet. I also emailed Google Support in hopes they can help.
Can anyone shed some light on this?
Thanks!!!

#MoGa suggestion was the correct one. Target v23 and set Minimum SDK to 21. This worked very well, and allows me to continue to target all the devices we need to.

Related

Should I install all the SDKs in Android Studio's SDK manager?

How it works? Like, if I have android 12 sdk installed, will the compiled apk work in all the lower versions?
Yeah, dumb question, but the subject isn't really googlable, so don't blame me. I've found the answer later, not even googling for it.
All the higher version SDKs are compatible with the lower versions. That's it.

How to expand Android version target version for existing app

I have an app in the Play Store that originally targeted API 19+, this was great, then somehow just before Christmas we uploaded a new version that targeted API 21+. Not so much of a problem as an annoyance, but when I uploaded a new version of the app today I got an error on the API 21+ update and was told that I had to have a version that targeted API 23+.
I want to get this app back so it covers all versions of Android from 4.4 > 8.1. But I don't know how.
I uploaded the API21+ apk, and the API23+ version (with different version numbers in the same release (because you have to do that), but the error still persists for the 21+, so I had to remove it to get the update in.
How can I achieve this, currently stuck with an api 23 app, which should be 19.
I am using Xamarin.Forms, in Visual Studio 2017, all of the latest updates, publishing through the web as you can't upload from VS if you need multiple packages in the same release (I don't think).
Thanks everyone.
EDIT
Right, I have the solution to my problem, but I have no idea how to execute it. How do I set the minSdkVersion, maxSdkVersion and targetSdkVersion, using code, in Xamarin and Visual Studio. As the manifest is written at compile time, my options for editing the base manifest wont work (I tried).
You seem to be confusing target SDK and minSDK.
Target SDK says which SDK you used to develop, and have you correctly handled things like runtime permissions which only came in with SDK 23.
You might find this blog post helpful in explaining the differences.
For more information see:
SDK 23 based permissions
Requesting permissions at runtime
It sounds like you want a single SDK with minSDK=19 and targetSDK=23, this is perfectly OK.
So, this seems to be a thing: https://developer.android.com/google/play/publishing/multiple-apks.html
Sadly, you have to edit the manifest manually to create the different versions and then archive it for each release, with a new version number. But it works.

Android app Publish Error

I am getting this Error when I try to publish this app in the store to an update of existing app. I am using Visual studio Apache Cordova Tools to build the apk and the previous version was published with Intel XDK
It is forbidden that a device upgrading from API levels in range 16-23 to API levels in range 24+ should downgrade from version 48 to version 9, which would occur when
Screen layouts containing any of [small, normal, large, xlarge] and
Features containing all of [android.hardware.screen.PORTRAIT, android.hardware.TOUCHSCREEN].
Please let me know why I am getting this issue. Also possible solutions for this.
Thanks a lot
This is not due to the tool you used for build. I faced the same issue. Here is what I was trying to do.
I had my version 5 covering minSDK as 8 to maxSDK as 23.
I released a version 6 from 14 to 23. In this build I found that app was crashing for version from 14 to 20 but working fine above 21+
So I wanted to create a version 7 covering from 21+ and also enable version 5 in play store console so that rest of the devices running 14 to 20 also can be covered by version 5.
But since we have already published a version which has given coverage for devices running api 14 to 23, we are asking Google to downgrade those devices.
And that is why you see
"It is forbidden that a device upgrading from API levels in range 16-23 to API levels in range 24+ should downgrade from version 48 to version 9, which would occur when "
Please ensure you are not downgrading the devices running those api which you had given an updated version already. Check your build.gradle file or Manifest to confirm the same.
In my case, I solved this by fixing the issues causing the crash and released version 7 that works fine from API 14 to 23. Hope this helps.
Finally I fixed but what I did to fix is uncertain
I tried to update Visual Studio 2015 Tools for Apache Cordova (update 7) and also updated cordova to 5.4.1 and a rebuild fixed the issue in store.
so I am not sure what was the cause and what fixed it. but definitely just serveral rebuilds didnt fix though.
Hope this will help someone in future

Can I only install the newest Android API to target lower API Version?

Say I wanna make an app with :
android:minSdkVersion="8"
android:targetSdkVersion="22"
My questions :
Do I need to install both "min SDK Version" as well as the target SDK version?
How if I only have SDK Version of 23 only? Can I make such setting? Or do I need to have both 22 as well as 8?
Can I debug such app with API / SDK Ver 21 phone?
Is it enough to only have the latest SDK version to develop any kind of app?
It is okay if there's any source (link) to comprehensive rule about such ruling, since I didn't found it even after extensive searching.
P.S. I don't know if this info is needed, but the app I wanna make is a libgdx game app.
Thanks
No. (the other answer is wrong)
You only need to have the version that you building with (compileSdkVersion in build.gradle). If you only have 23, then build with 23.
Usually, you should target the same version you build with. However, libgdx is not always fully tested with the latest Android. Check here under Android build version to see what it has been tested for. This is the SDK level you should should target if you want to be sure not to have any problems. Right now, it is version 20 of Android.
I have been targeting Android 22 without issue (that I know of), though. I haven't yet released something higher than 20 yet so no guarantees that it's perfectly safe.
Yes.
Yes. Generally, the target SDK version and the build SDK version should match, but it works if you target a lower version than you're building with.
Targeting a later API basically changes some default behavior of apps. Theoretically, you should be testing on devices spanning the full range of API levels that you support, but in practice this is unnecessary for a libgdx game. But if you target a version that's too old, you might miss out on some newer features. For example, if you target <19, immersive mode (which is desirable for most games) cannot be supported.
Yes you need to install
If you have SDK Version of 23 only but you want to build it in version 22 then also you need to install vesrsion 22 SDK.
Yes you can easily debug such app with API / SDK Ver 21 phone.
I think its enough.

Android Developer: change version

Is there a way to change the Android version on my app without redoing everything? I just realized that Nook Color only has version 1.4. Well, I have my app set at 3.2 ... so those who have the Nook Color will not be able to access it. Why on earth did I do this to myself!
I am using Eclipse.
You can certainly create multiple .apk files for different versions. See this article about it. However, you may not need to if you haven't used any 3.2 API calls. You may be able to just change the minimum sdk level in the manifest file, update the version code, and republish your app.
You don't have to redo everything , but you can't use 3.2 API on nook color. You'll have to lower your minSDK version in your AndroidManifest.xml to the nook and test your application. If it doesn't compile you can look at using the compatibility libraries allow your app to run on older versions of Android if you are using API calls that aren't available on whatever the nook runs. 1.4 isn't a real version FYI.
http://developer.android.com/sdk/compatibility-library.html
Now you might run into bugs that exist in earlier versions that have been fixed in 3.2. Those bugs might require you rework your features.

Categories

Resources