where could i find flutter SDK Min and mix in VS Code - android

where should i find minSdkVersion from 16 to 21

android/app/build.gradle
it will look like this
defaultConfig {*
applicationId "***"
minSdkVersion 22
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName*
}

Related

Which file contains a list of the following variables?

Within ../android/app/build.gradle, there is a section that looks like this:
android {
defaultConfig {
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
}
Now, flutter.minSdkVersion seems to be a variable located in which file within my project?
It is the default values flutter takes.
You should updates these as per needed. For latest flutter android build, it should be
android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
}
You have to go to \android\local.properties
Then add
flutter.minSdkVersion = 26 // the version is up to your needs.
flutter.targetSdkVersion = 32
After that return to defaultConfig of build.gradle and call it like this :
defaultConfig {
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Don't forget to launch a flutter clean flutter pub get and then flutter run

Flutter minSdkVersion and targetSdkVersion error

In the old version, we could change it via android/app/build.gradle. Now it gives an error when we change it.
defaultConfig {
applicationId "com.example.manuel"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
There are those who fix this problem via local.properties, but this method does not work either.
sdk.dir=C:/Users/user/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
you need to edit the build.gradle file in the new version as well. As follows;
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.manuel"
minSdkVersion 16 // <--- There minSdkVersion Content
targetSdkVersion 27 <--- There targetSdkVersion (is actually Max Sdk Version) Content
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
then rebuild the project and build it again.
I hope that will be useful.

Android Studio What is the difference between minSdkVersion, targetSdkVersion and minSdk, targetSdk?

I changed Target SDK Version from 30 to 31 and Min SDK Version from 19 to 22. In build.gradle, the minSdkVersion, targetSdkVersion and targetSdk change accordingly except for minSdk. It is still 19.
android {
compileSdk 31
defaultConfig {
applicationId "com.example.studentsacademicmanagementappsama"
minSdk 19
targetSdk 31
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
targetSdkVersion 31
minSdkVersion 22
}
}
What is the difference between minSdkVersion, targetSdkVersion and minSdk, targetSdk?
Should I change minSdk to 22 or ignore it?
As of the Android Gradle Plugin released in July 2021, you can use either minSdk or minSdkVersion, targetSdk or targetSdkVersion, compileSdk or compileSdkVersion. Why they did this, I'm not sure.
More details on this better answer over here: https://stackoverflow.com/a/67251145/467509
There is no such thing named minSdk , targetSdk and compileSdk in build.gradle.
you should config your app compatibility like this :
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.app.test"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0.0"
}
}

minSdkVersion is newer than the device API Level error while installing app

I am installing Android app with target sdk version android S in Android phone with Api level 30. My default config settings for app is like
compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion "S"
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
But when I install the apk in Emulator with Api Level 30 I am getting error as
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK
The application's minSdkVersion is newer than the device API level.
How to resolve this ? Which things need to be modified to make it working ?
targetSdkVersion "S"
Using a prelimary version the minSdkVersion becomes S too automatically.
Changing to this version worked
compileSdkVersion 'android-S'
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Problems compiling RenderScript

I've followed this tutorial:
https://futurestud.io/blog/how-to-blur-images-efficiently-with-androids-renderscript/
However, wherever the rs variable is mentioned, I get the following error:
Wrong 1st argument type. Found: 'android.support.v8.renderscript.RenderScript', required: 'android.renderscript.RenderScript'
This is my build.gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.test.app"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
}
What am I doing wrong?
If you are importing:
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
Replaces those lines only by:
android.support.v8.renderscript.*
Good luck! (:
Yeah, you are mixing and matching "android.renderscript" and "android.support.v8.renderscript", as mentioned by #user5195185.
Also, try use Build-Tools 23.0.3 which includes several fixes for the support lib:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.test.app"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
}

Categories

Resources