Skip to content

Commit a8f4662

Browse files
refactor: update compile and target SDK versions
- Update compile SDK version to use project property if available, fallback to default - Update target SDK version to use project property if available, fallback to default
1 parent 3f62939 commit a8f4662

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ rootProject.allprojects {
2525

2626
ext {
2727
compile_sdk_version = 35
28-
build_tools_version = "35.0.0"
2928
min_sdk_version = 21
3029
}
3130

3231
android {
3332
namespace 'com.optimizely.optimizely_flutter_sdk'
34-
compileSdkVersion compile_sdk_version
35-
buildToolsVersion build_tools_version
33+
compileSdkVersion rootProject.hasProperty('flutter.compileSdkVersion')
34+
? rootProject.flutter.compileSdkVersion.toInteger()
35+
: compile_sdk_version
3636

3737
buildFeatures {
3838
buildConfig true

example/android/app/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ if (flutterVersionName == null) {
2525

2626
android {
2727
namespace "com.optimizely.optimizely_flutter_sdk_example"
28-
compileSdkVersion 35
28+
29+
compileSdkVersion rootProject.hasProperty('flutter.compileSdkVersion')
30+
? rootProject.flutter.compileSdkVersion.toInteger()
31+
: 35
2932

3033
compileOptions {
3134
sourceCompatibility JavaVersion.VERSION_1_8
@@ -38,7 +41,10 @@ android {
3841
// You can update the following values to match your application needs.
3942
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
4043
minSdkVersion flutter.minSdkVersion
41-
targetSdkVersion 35
44+
targetSdkVersion rootProject.hasProperty('flutter.targetSdkVersion')
45+
? rootProject.flutter.targetSdkVersion.toInteger()
46+
: 35
47+
4248
versionCode flutterVersionCode.toInteger()
4349
versionName flutterVersionName
4450
}

0 commit comments

Comments
 (0)