Compiling for multiple sdk versions - android

I have installed SDK 16 (android 4.1), 20 (android 4.4) and 27 (android 8.1) and the code is configured with the following specs
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.test.android"
minSdkVersion 16
targetSdkVersion 25
versionCode 25
versionName "2.6.7"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
I want to make sure that the app is fine when installing on an android 4.1. Is that enough to modify compileSdkVersion to 16? Or I have to change buildToolsVersion accordingly?

target and compile level should be the highest possible and you must do so as Google will happen to reject low targets in the future.
Incompatible code will be noted in the IDE as red warnings as you develop. Usually with such a warning as: "Code XX need a newer version (22) and minSdk is 16"
Those errors make your app incompatible for older for versions.

Related

minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0]

Following is my React-Native app's configuration,
android/app/buid.gradle:
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
compileSdkVersion 30
buildToolsVersion '30.0.3'
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'mlkit'
missingDimensionStrategy 'react-native-camera', 'general'
}
gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
Facing following error when I run from Android Studio
minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0]
I must support minSdkVersion 19 as many of my users are still using lower versions of android.
Hence, How can i continue with minSdkVersion 19 with out any error?
Note: I have gone through the suggested question and have already applied suggested changes. But still facing the error.

How to make Apk available in play store for the version 6 android phones

I have published my application with a minimum SDK 23 but unfortunately, it's not showing the application in the play store for the android version 6 phones. I have tried to downgrade to a minimum SDK 22 but still failed to solve the problem.
Here is my minSdk version
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.ioradix.ryogas"
minSdk 23
targetSdkVersion 30
versionCode 19
versionName "1.0.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
How may I make available the app in the play store for android version 6 devices?
Thanks in advance.

Which compileSdkVersion should I use in my android project?

I'm using latest dependencies in my project. My minSdkVersion is set as 15 and targetSdkVersion is 26. Which build tools and compileSdkVersion should I use so that the app can be run even in Adnroid 5.
Here are the details-
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Will these work fine in all devices or I have to reduce the CompileSdkVersion?
Always follow this,
minSdkVersion <= targetSdkVersion <= compileSdkVersion
Because, when you develop app always target the latest SDK so that you provide the latest features of Google to your user.
According to source.android.com if you want to make your App can be run in Adnroid 5 and newer, you should set the minSdkVersion to 21
tip: don't make your minSdkVersion lower than 21
Your application will work in the range of minSdkVersion and targetSdkVersion api level.
You should target your app to the latest version of Android SDK version (see SDK Platform release notes) to make sure you've covered all the Android version. It also force you to check if your code is working correctly with the latest version.
So, change your app build.gradle to something like this:
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 28 // latest stdk
versionCode 1
versionName "1.0"
Ideally, your targetSdkVersion and compileSdkVersion should be the same, and the latest. That's 28 at the current time of writing.
minSdkVersion dictates the minimum version your app will support, so having a compile/target of 28 will still let you run on 15.

Device with compatible configuration is not compatible on the Play Market

My build.gradle default config:
android {
compileSdkVersion 27
defaultConfig {
applicationId "my.app"
minSdkVersion 19
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "1"
vectorDrawables.useSupportLibrary = true
}
...
}
But for a Samsung Galaxy J1 using Android version 6.0.1 it says that the device is not compatible.
Question: What can be a reason?
Note:
The project uses mixed Kotlin and Java code. What more data should I share to help find an answer?

Cannot publish app to PlayStore - It is forbidden to downgrade devices which previously used M permissions

I am unable to understand the error. What I understood is that in my 14th version targetSdkVersion was 23 and now I am unable to upload the apk.
I now have targetSdkVersion = 22 and even for my previous version targetSdkVersion was 22.
I want to launch the app asap. But stuck with this problem.
Gradle
defaultConfig {
applicationId "***"
versionCode 30
versionName "3.0"
multiDexEnabled true
compileSdkVersion 23
buildToolsVersion "23.1.1"
minSdkVersion 14
targetSdkVersion 22
}
It appears you have uploaded an APK to prod that uses the M runtime permissions model (level 23); This means that you can't downgrade to 22. This is due to the changed permissions model between these different versions.
To be clear, you won't be able to distribute your APK targeting API 22 again, and there is not a way to change this.

Categories

Resources