flutter-permission-handler
flutter-permission-handler copied to clipboard
local.properties + require a higher Android SDK version
however local.properties set compileSdkVersion to 33
flutter.compileSdkVersion=33 compiling warning appears:
One or more plugins require a higher Android SDK version.
Fix this issue by adding the following to C:\Source\Neorise\jkapp\jkapp\android\app\build.gradle:
android {
compileSdkVersion 33
...
}
permission_handler version 10.0.0
same problem with this version
Hi @zs-dima, @Nekketsu-GIT I have tried adding the permission handler 10.0.0 and changed my android > app > build.gradle
according to what the error says. For me it worked.
My build.gradle
looks like this now:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.test_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Have you tried rebuilding your project? maybe it's a caching issue somehow?
Let me know if it helped so I can close the issue!
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
please keep it open, I have the same!
I have the same! problem
Same problem here
Adding these lines inside android/local.properties
file solved the issue for me:
flutter.minSdkVersion=33
flutter.targetSdkVersion=33
flutter.compileSdkVersion=33
@Thoumar minSdkVersion should not be flutter.minSdkVersion = 33
in most cases, and probably wont fix this issue. It should only be 33 if your app only targets API level 33 Android devices. You can use flutter.minimumSdkVersion
constant if you want to target the lowest API level possible (right now it's set to 16 I believe, but can change in the future). elsewise the minSdkVersion should be the lowest API level you want to be supported by your app.
For the people still having this problem; please send your build.gradle
file so I can see if there's something wrong, since I can't reproduce this issue.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.
/your_project/android/local.properties
file add flutter.compileSdkVersion=33
this line and /your_project/android/app/build.gradle
for this file update with below code
android {
// compileSdkVersion flutter.compileSdkVersion
compileSdkVersion localProperties.getProperty('flutter.compileSdkVersion').toInteger()
}
update your compileSdkVersion and comment the older one
it works for me
Thanks
please watch this video https://youtu.be/itluFkwTUwY
please watch this video https://youtu.be/itluFkwTUwY
@ptsdeen2007 always better to avoid hard code. Use local.properties
variable. it's flutter recommended. Thanks