Skip to content

Commit 7555707

Browse files
authored
fix(android): build on Firebase BoM 35 and require minSdk 24 (#18782)
* fix(android): resolve Firebase BoM 35 Firestore and ML Model Downloader deps BoM 35 no longer manages ML Model Downloader, and Firestore 27 publishes test libraries as runtime dependencies that Jetifier cannot transform. * refactor(android)!: require minSdk 24 for Firebase BoM 35 BoM 35 raises the Firebase libraries to API 24. Plugin configs and example apps that still pinned 23 would fail to compile against those libraries. * fix(android): floor example apps at minSdk 24 Flutter 3.27 through 3.32 still default minSdk to 21. Those example apps would fail manifest merger against BoM 35 libraries.
1 parent d14c4dc commit 7555707

39 files changed

Lines changed: 48 additions & 40 deletions

File tree

‎packages/cloud_firestore/cloud_firestore/android/build.gradle‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ android {
6161
dependencies {
6262
api firebaseCoreProject
6363
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
64-
implementation 'com.google.firebase:firebase-firestore'
64+
// Firestore 27 publishes test libraries as runtime dependencies. Mockito
65+
// pulls byte-buddy 1.17.7, which Jetifier cannot transform.
66+
implementation('com.google.firebase:firebase-firestore') {
67+
exclude group: 'org.mockito', module: 'mockito-core'
68+
exclude group: 'junit', module: 'junit'
69+
exclude group: 'com.google.truth', module: 'truth'
70+
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
71+
}
6572
}
6673
}
6774

‎packages/cloud_firestore/cloud_firestore/android/local-config.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ext {
22
compileSdk=34
3-
minSdk=23
3+
minSdk=24
44
targetSdk=34
55
javaVersion = JavaVersion.toVersion(17)
66
androidGradlePluginVersion = '8.3.0'

‎packages/cloud_firestore/cloud_firestore/example/android/app/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
applicationId = "io.flutter.plugins.firebase.firestore.example"
4343
// You can update the following values to match your application needs.
4444
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
45-
minSdkVersion = flutter.minSdkVersion
45+
minSdkVersion = Math.max(flutter.minSdkVersion, 24)
4646
targetSdk = flutter.targetSdkVersion
4747
versionCode = flutterVersionCode.toInteger()
4848
versionName = flutterVersionName

‎packages/cloud_firestore/cloud_firestore/pipeline_example/android/app/build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323
applicationId = "com.example.pipeline_example"
2424
// You can update the following values to match your application needs.
2525
// For more information, see: https://flutter.dev/to/review-gradle-config.
26-
minSdk = flutter.minSdkVersion
26+
minSdk = maxOf(flutter.minSdkVersion, 24)
2727
targetSdk = flutter.targetSdkVersion
2828
versionCode = flutter.versionCode
2929
versionName = flutter.versionName

‎packages/cloud_functions/cloud_functions/android/local-config.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ext {
22
compileSdk=34
3-
minSdk=23
3+
minSdk=24
44
targetSdk=34
55
javaVersion = JavaVersion.toVersion(17)
66
androidGradlePluginVersion = '8.3.0'

‎packages/cloud_functions/cloud_functions/example/android/app/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ android {
4141
applicationId = "io.flutter.plugins.firebase.functions.example"
4242
// You can update the following values to match your application needs.
4343
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
44-
minSdkVersion = flutter.minSdkVersion
44+
minSdkVersion = Math.max(flutter.minSdkVersion, 24)
4545
targetSdk = flutter.targetSdkVersion
4646
versionCode = flutterVersionCode.toInteger()
4747
versionName = flutterVersionName

‎packages/firebase_ai/firebase_ai/android/local-config.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ext {
22
compileSdk=34
3-
minSdk=23
3+
minSdk=24
44
targetSdk=34
55
javaVersion = JavaVersion.toVersion(17)
66
androidGradlePluginVersion = '8.3.0'

‎packages/firebase_ai/firebase_ai/example/android/app/build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525
applicationId = "io.flutter.plugins.firebase.tests"
2626
// You can update the following values to match your application needs.
2727
// For more information, see: https://flutter.dev/to/review-gradle-config.
28-
minSdk = flutter.minSdkVersion
28+
minSdk = maxOf(flutter.minSdkVersion, 24)
2929
targetSdk = flutter.targetSdkVersion
3030
versionCode = flutter.versionCode
3131
versionName = flutter.versionName

‎packages/firebase_analytics/firebase_analytics/android/local-config.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ext {
22
compileSdk=34
3-
minSdk=23
3+
minSdk=24
44
targetSdk=34
55
javaVersion = JavaVersion.toVersion(17)
66
androidGradlePluginVersion = '8.3.0'

‎packages/firebase_analytics/firebase_analytics/example/android/app/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747
applicationId = "io.flutter.plugins.firebase.tests"
4848
// You can update the following values to match your application needs.
4949
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
50-
minSdk = 23
50+
minSdk = 24
5151
targetSdk = flutter.targetSdkVersion
5252
versionCode = flutterVersionCode.toInteger()
5353
versionName = flutterVersionName

0 commit comments

Comments
 (0)