diff --git a/Android/firebase_dependencies.gradle b/Android/firebase_dependencies.gradle index 791ad19c85..e838eec0b3 100644 --- a/Android/firebase_dependencies.gradle +++ b/Android/firebase_dependencies.gradle @@ -16,26 +16,26 @@ import org.gradle.util.ConfigureUtil; // A map of library to the dependencies that need to be added for it. def firebaseDependenciesMap = [ - 'app' : ['com.google.firebase:firebase-analytics:21.0.0'], + 'app' : ['com.google.firebase:firebase-analytics'], 'play_services' : ['com.google.android.gms:play-services-base:18.0.1'], 'admob' : ['com.google.firebase:firebase-ads:19.8.0', - 'com.google.firebase:firebase-analytics:21.0.0'], - 'analytics' : ['com.google.firebase:firebase-analytics:21.0.0'], - 'auth' : ['com.google.firebase:firebase-auth:21.0.5'], - 'database' : ['com.google.firebase:firebase-database:20.0.5'], - 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:21.0.1'], - 'firestore' : ['com.google.firebase:firebase-firestore:24.1.2'], - 'functions' : ['com.google.firebase:firebase-functions:20.1.0'], - 'installations' : ['com.google.firebase:firebase-installations:17.0.1'], - 'invites' : ['com.google.firebase:firebase-invites:17.0.0'], + 'com.google.firebase:firebase-analytics'], + 'analytics' : ['com.google.firebase:firebase-analytics'], + 'auth' : ['com.google.firebase:firebase-auth'], + 'database' : ['com.google.firebase:firebase-database'], + 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], + 'firestore' : ['com.google.firebase:firebase-firestore'], + 'functions' : ['com.google.firebase:firebase-functions'], + 'installations' : ['com.google.firebase:firebase-installations'], + 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. - 'messaging' : ['com.google.firebase:firebase-messaging:23.0.5', + 'messaging' : ['com.google.firebase:firebase-messaging', 'firebase_cpp_sdk.messaging:messaging_java', 'androidx.core:core:1.6.0-alpha03', 'com.google.flatbuffers:flatbuffers-java:1.12.0'], - 'performance' : ['com.google.firebase:firebase-perf:20.1.0'], - 'remote_config' : ['com.google.firebase:firebase-config:21.1.0'], - 'storage' : ['com.google.firebase:firebase-storage:20.0.1'], + 'performance' : ['com.google.firebase:firebase-perf'], + 'remote_config' : ['com.google.firebase:firebase-config'], + 'storage' : ['com.google.firebase:firebase-storage'], 'testlab' : [] ] @@ -149,6 +149,10 @@ project.afterEvaluate { firebaseCpp.dependencies.libSet.add('play_services') } + // Add the bill-of-materials + project.dependencies { + implementation platform('com.google.firebase:firebase-bom:30.1.0') + } for (String lib : firebaseCpp.dependencies.libSet) { // Generate and include the proguard file generateAndAddProguard(lib) @@ -166,4 +170,5 @@ project.afterEvaluate { } } } + } diff --git a/admob/admob_resources/build.gradle b/admob/admob_resources/build.gradle index 533dc5d3e3..de599fb709 100644 --- a/admob/admob_resources/build.gradle +++ b/admob/admob_resources/build.gradle @@ -45,7 +45,8 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-ads:19.8.0' } diff --git a/app/app_resources/build.gradle b/app/app_resources/build.gradle index 3a883d8eb3..d88d34784c 100644 --- a/app/app_resources/build.gradle +++ b/app/app_resources/build.gradle @@ -50,7 +50,8 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' } afterEvaluate { diff --git a/app/google_api_resources/build.gradle b/app/google_api_resources/build.gradle index 8575019e3b..3893166c00 100644 --- a/app/google_api_resources/build.gradle +++ b/app/google_api_resources/build.gradle @@ -53,7 +53,8 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.gms:play-services-base:18.0.1' implementation project(':app:app_resources') } diff --git a/app/integration_test/build.gradle b/app/integration_test/build.gradle index 20c9e2df2e..99edc8dd0f 100644 --- a/app/integration_test/build.gradle +++ b/app/integration_test/build.gradle @@ -76,7 +76,7 @@ android { apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle" firebaseCpp.dependencies { - app + appWithoutPlayServices } apply plugin: 'com.google.gms.google-services' diff --git a/app/invites_resources/build.gradle b/app/invites_resources/build.gradle index 06669d0f1b..3e05de32fe 100644 --- a/app/invites_resources/build.gradle +++ b/app/invites_resources/build.gradle @@ -49,8 +49,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-dynamic-links:21.0.1' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-dynamic-links' implementation project(':app:app_resources') } diff --git a/auth/auth_resources/build.gradle b/auth/auth_resources/build.gradle index a77783bdad..780937f5c2 100644 --- a/auth/auth_resources/build.gradle +++ b/auth/auth_resources/build.gradle @@ -49,8 +49,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-auth:21.0.5' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-auth' implementation project(':app:app_resources') } diff --git a/database/database_resources/build.gradle b/database/database_resources/build.gradle index d864bbe1ab..f22e3c22b3 100644 --- a/database/database_resources/build.gradle +++ b/database/database_resources/build.gradle @@ -45,8 +45,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-database:20.0.5' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-database' //implementation project(':app:app_resources') } diff --git a/firestore/firestore_resources/build.gradle b/firestore/firestore_resources/build.gradle index 4a9f0085bf..7543026654 100644 --- a/firestore/firestore_resources/build.gradle +++ b/firestore/firestore_resources/build.gradle @@ -53,8 +53,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-firestore:24.1.2' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-firestore' } afterEvaluate { diff --git a/messaging/messaging_java/build.gradle b/messaging/messaging_java/build.gradle index 34e1f6eefa..a9e8057859 100644 --- a/messaging/messaging_java/build.gradle +++ b/messaging/messaging_java/build.gradle @@ -55,8 +55,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-messaging:23.0.5' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-messaging' implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0' } diff --git a/release_build_files/Android/firebase_dependencies.gradle b/release_build_files/Android/firebase_dependencies.gradle index e0b91f729d..46012c7650 100644 --- a/release_build_files/Android/firebase_dependencies.gradle +++ b/release_build_files/Android/firebase_dependencies.gradle @@ -16,26 +16,26 @@ import org.gradle.util.ConfigureUtil; // A map of library to the dependencies that need to be added for it. def firebaseDependenciesMap = [ - 'app' : ['com.google.firebase:firebase-analytics:21.0.0'], + 'app' : ['com.google.firebase:firebase-analytics'], 'play_services' : ['com.google.android.gms:play-services-base:18.0.1'], 'admob' : ['com.google.firebase:firebase-ads:19.8.0', - 'com.google.firebase:firebase-analytics:21.0.0'], - 'analytics' : ['com.google.firebase:firebase-analytics:21.0.0'], - 'auth' : ['com.google.firebase:firebase-auth:21.0.5'], - 'database' : ['com.google.firebase:firebase-database:20.0.5'], - 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links:21.0.1'], - 'firestore' : ['com.google.firebase:firebase-firestore:24.1.2'], - 'functions' : ['com.google.firebase:firebase-functions:20.1.0'], - 'installations' : ['com.google.firebase:firebase-installations:17.0.1'], - 'invites' : ['com.google.firebase:firebase-invites:17.0.0'], + 'com.google.firebase:firebase-analytics'], + 'analytics' : ['com.google.firebase:firebase-analytics'], + 'auth' : ['com.google.firebase:firebase-auth'], + 'database' : ['com.google.firebase:firebase-database'], + 'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'], + 'firestore' : ['com.google.firebase:firebase-firestore'], + 'functions' : ['com.google.firebase:firebase-functions'], + 'installations' : ['com.google.firebase:firebase-installations'], + 'invites' : ['com.google.firebase:firebase-invites'], // Messaging has an additional local dependency to include. - 'messaging' : ['com.google.firebase:firebase-messaging:23.0.5', + 'messaging' : ['com.google.firebase:firebase-messaging', 'com.google.firebase.messaging.cpp:firebase_messaging_cpp@aar', 'androidx.core:core:1.6.0-alpha03', 'com.google.flatbuffers:flatbuffers-java:1.12.0'], - 'performance' : ['com.google.firebase:firebase-perf:20.1.0'], - 'remote_config' : ['com.google.firebase:firebase-config:21.1.0'], - 'storage' : ['com.google.firebase:firebase-storage:20.0.1'], + 'performance' : ['com.google.firebase:firebase-perf'], + 'remote_config' : ['com.google.firebase:firebase-config'], + 'storage' : ['com.google.firebase:firebase-storage'], 'testlab' : [] ] @@ -124,6 +124,10 @@ project.afterEvaluate { firebaseCpp.dependencies.libSet.add('play_services') } + // Add the bill-of-materials + project.dependencies { + implementation platform('com.google.firebase:firebase-bom:30.1.0') + } for (String lib : firebaseCpp.dependencies.libSet) { // Messaging includes an aar, which to be depended on properly requires // the folder containing it to be added this way. diff --git a/release_build_files/readme.md b/release_build_files/readme.md index f637148e1d..e3a87dc08c 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -78,88 +78,91 @@ distributed as part of the core Firebase Feature | Required Libraries and Gradle Packages -------------------------- | -------------------------------------- +All Firebase SDKs | platform(com.google.firebase:firebase-bom:30.0.0) +| | (Android Bill of Materials) Firebase AdMob | libfirebase_admob.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) | | com.google.firebase:firebase-ads:19.8.0 | | (Maven package) -| | com.google.android.gms:play-services-base:18.0.1 -| | (Maven package) Firebase Analytics | libfirebase_analytics.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) Firebase Authentication | libfirebase_auth.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-auth:21.0.5 +| | com.google.firebase:firebase-auth | | (Maven package) Firebase Dynamic Links | libfirebase_dynamic_links.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-dynamic-links:21.0.1 +| | com.google.firebase:firebase-dynamic-links | | (Maven package) Cloud Firestore | libfirebase_firestore.a | | libfirebase_auth.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-firestore:24.1.2 +| | com.google.firebase:firebase-firestore | | (Maven package) -| | com.google.firebase:firebase-auth:21.0.5 +| | com.google.firebase:firebase-auth | | (Maven package) Firebase Functions | libfirebase_functions | | libfirebase_auth.a (optional) | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-functions:20.1.0 +| | com.google.firebase:firebase-functions | | (Maven package) -| | com.google.firebase:firebase-auth:21.0.5 +| | com.google.firebase:firebase-auth | | (Maven package) Firebase Installations | libfirebase_installations.a | | libfirebase_app.a -| | com.google.firebase:firebase-installations:17.0.1 +| | com.google.firebase:firebase-installations | | (Maven package) Firebase Messaging | libfirebase_messaging.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-messaging:23.0.5 +| | com.google.firebase:firebase-messaging | | (Maven package) | | libmessaging_java.jar (Android service) -| | androidx.core:core:1.7.0 (Maven package) +| | androidx.core:core:1.8.0 (Maven package) Firebase Realtime Database | libfirebase_database.a | | libfirebase_auth.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-database:20.0.5 +| | com.google.firebase:firebase-database | | (Maven package) -| | com.google.firebase:firebase-auth:21.0.5 +| | com.google.firebase:firebase-auth | | (Maven package) Firebase Remote Config | libfirebase_remote_config.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics | | (Maven package) -| | com.google.firebase:firebase-config:21.1.0 +| | com.google.firebase:firebase-config | | (Maven package) Firebase Storage | libfirebase_storage.a | | libfirebase_auth.a | | libfirebase_app.a -| | com.google.firebase:firebase-analytics:21.0.0 +| | com.google.firebase:firebase-analytics +| | (Maven package) +| | com.google.firebase:firebase-storage | | (Maven package) -| | com.google.firebase:firebase-storage:20.0.1 +| | com.google.firebase:firebase-auth | | (Maven package) -| | com.google.firebase:firebase-auth:21.0.5 +Google Play services module| com.google.android.gms:play-services-base:18.0.1 | | (Maven package) -Important: Each version of the Firebase C++ SDK supports specific Firebase -Android SDK module versions. Please ensure that you reference the correct -version of each Maven package listed above in your Gradle file. +The Firebase C++ SDK uses an Android BoM (Bill of Materials) to specify a single +Firebase Android SDK version number to use, rather than individual versions for +each library. For more information, please see the [Firebase Android SDK +documentation](https://firebase.google.com/docs/android/learn-more#bom). Note: AdMob C++ is not currently compatible with the latest Firebase AdMob Android SDK (20.x.x). Please ensure that you use firebase-ads version 19.8.0 in @@ -169,10 +172,10 @@ compatibility. #### Gradle dependency file Firebase C++ includes an `Android/firebase_dependencies.gradle` file -that helps you include the correct Android dependencies and native C++ -libraries for each Firebase product. To use it, include the following -in your build.gradle file (you can omit any Firebase products you -aren't using): +that helps you include the correct Android dependencies and Proguard +files for each Firebase product. To use it, include the following in +your build.gradle file (you can omit any Firebase products you aren't +using): ``` apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle" @@ -192,6 +195,16 @@ firebaseCpp.dependencies { } ``` +#### Google Play services module + +If you wish to use the `google_play_services::CheckAvailability` and +`MakeAvailable` functions, or `firebase::ModuleInitializer`, you must include +com.google.android.gms:play-services-base as a dependency as well, as listed +under "Google Play services module" in the table above. If you use the Gradle +dependency file described above, this dependency will automatically be included. +To omit it (not recommended), specify `appWithoutPlayServices` instead of `app` +in `firebaseCpp.dependencies`. + ### iOS Dependencies iOS users can include either xcframeworks or static libraries depending upon their @@ -598,6 +611,11 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Upcoming Release +- Changes + - General (Android): Switched over to Android BoM (Bill of Materials) + for dependency versions. This requires Gradle 5. + ### 9.1.0 - Changes - General (Android): Fixed a bug that required Android apps to include diff --git a/storage/storage_resources/build.gradle b/storage/storage_resources/build.gradle index f40b419b51..c9e1cbc4d0 100644 --- a/storage/storage_resources/build.gradle +++ b/storage/storage_resources/build.gradle @@ -49,8 +49,9 @@ android { } dependencies { - implementation 'com.google.firebase:firebase-analytics:21.0.0' - implementation 'com.google.firebase:firebase-storage:20.0.1' + implementation platform('com.google.firebase:firebase-bom:30.0.0') + implementation 'com.google.firebase:firebase-analytics' + implementation 'com.google.firebase:firebase-storage' } afterEvaluate {