Skip to content

Commit 0c5b087

Browse files
committed
chore(android): rely on single firestore-android-sdk version, bump annotations
1 parent 39ffe50 commit 0c5b087

File tree

9 files changed

+51
-22
lines changed

9 files changed

+51
-22
lines changed

packages/firebase_core/firebase_core/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ android {
3636
}
3737
dependencies {
3838
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrDefaultProperty("FirebaseSDKVersion")}")
39-
implementation "com.google.firebase:firebase-core"
39+
implementation "com.google.firebase:firebase-common"
4040

4141
implementation 'androidx.annotation:annotation:1.1.0'
4242
}

packages/firebase_core/firebase_core/example/android/app/build.gradle

-7
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ if (flutterVersionName == null) {
2424
apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

27-
// Optionally override the Firebase BoM SDK version that FlutterFire uses.
28-
// rootProject.ext {
29-
// set("FlutterFire", [
30-
// FirebaseSDKVersion: "25.3.1",
31-
// ])
32-
// }
33-
3427
android {
3528
compileSdkVersion 29
3629

packages/firebase_in_app_messaging/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ android {
5252
}
5353

5454
dependencies {
55-
implementation 'com.android.support:support-annotations:28.0.0'
55+
implementation 'androidx.annotation:annotation:1.1.0'
5656
}
5757

5858
// TODO(<github-username>): Remove this hack once androidx.lifecycle is included on stable. https://github.com/flutter/flutter/issues/42348

packages/firebase_messaging/firebase_messaging/example/android/app/build.gradle

-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ apply plugin: 'com.android.application'
2525
apply plugin: 'com.google.gms.google-services'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

28-
rootProject.ext {
29-
set('FlutterFire', [
30-
FirebaseSDKVersion: '25.12.0'
31-
])
32-
}
33-
34-
3528
android {
3629
compileSdkVersion 29
3730

packages/firebase_ml_custom/android/build.gradle

+18-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ rootProject.allprojects {
2121

2222
apply plugin: 'com.android.library'
2323

24+
def firebaseCoreProject = findProject(':firebase_core')
25+
if (firebaseCoreProject == null) {
26+
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
27+
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
28+
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
29+
}
30+
31+
def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
32+
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
33+
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
34+
return rootProject.ext.get('FlutterFire').get(name)
35+
}
36+
2437
android {
2538
compileSdkVersion 29
2639

@@ -32,9 +45,11 @@ android {
3245
disable 'InvalidPackage'
3346
}
3447
dependencies {
35-
api 'com.google.firebase:firebase-ml-model-interpreter:22.0.3'
36-
implementation 'androidx.annotation:annotation:1.0.0'
37-
implementation 'androidx.exifinterface:exifinterface:1.0.0'
48+
api firebaseCoreProject
49+
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
50+
api 'com.google.firebase:firebase-ml-model-interpreter'
51+
implementation 'androidx.annotation:annotation:1.1.0'
52+
implementation 'androidx.exifinterface:exifinterface:1.3.1'
3853
}
3954
}
4055

packages/firebase_ml_vision/android/build.gradle

+16-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ rootProject.allprojects {
2121

2222
apply plugin: 'com.android.library'
2323

24+
def firebaseCoreProject = findProject(':firebase_core')
25+
if (firebaseCoreProject == null) {
26+
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
27+
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
28+
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
29+
}
30+
31+
def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
32+
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
33+
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
34+
return rootProject.ext.get('FlutterFire').get(name)
35+
}
36+
2437
android {
2538
compileSdkVersion 29
2639

@@ -32,8 +45,9 @@ android {
3245
disable 'InvalidPackage'
3346
}
3447
dependencies {
35-
api 'com.google.firebase:firebase-ml-vision:20.0.0'
36-
implementation 'com.google.firebase:firebase-common:16.1.0'
48+
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
49+
implementation 'com.google.firebase:firebase-common'
50+
api "com.google.firebase:firebase-ml-vision"
3751
implementation 'androidx.annotation:annotation:1.0.0'
3852
implementation 'androidx.exifinterface:exifinterface:1.0.0'
3953
}

packages/firebase_ml_vision/example/android/app/build.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ if (flutterVersionName == null) {
2424
apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

27+
def firebaseCoreProject = findProject(':firebase_core')
28+
if (firebaseCoreProject == null) {
29+
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
30+
} else if (!firebaseCoreProject.properties['FirebaseSDKVersion']) {
31+
throw new GradleException('A newer version of the firebase_core FlutterFire plugin is required, please update your firebase_core pubspec dependency.')
32+
}
33+
34+
def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
35+
if (!rootProject.ext.has('FlutterFire')) return firebaseCoreProject.properties[name]
36+
if (!rootProject.ext.get('FlutterFire')[name]) return firebaseCoreProject.properties[name]
37+
return rootProject.ext.get('FlutterFire').get(name)
38+
}
39+
2740
android {
2841
compileSdkVersion 29
2942

packages/firebase_performance/example/android/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if (flutterVersionName == null) {
2222
}
2323

2424
apply plugin: 'com.android.application'
25+
apply plugin: "com.google.firebase.firebase-perf"
2526
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2627

2728
android {

packages/firebase_storage/firebase_storage/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ android {
5959
api firebaseCoreProject
6060
implementation platform("com.google.firebase:firebase-bom:${getRootProjectExtOrCoreProperty("FirebaseSDKVersion", firebaseCoreProject)}")
6161
implementation 'com.google.firebase:firebase-storage'
62-
implementation 'androidx.annotation:annotation:1.0.0'
62+
implementation 'androidx.annotation:annotation:1.1.0'
6363
}
6464
}
6565

0 commit comments

Comments
 (0)