Skip to content

Commit

Permalink
Update Android dependencies - Wed Apr 19 2023 (firebase#1276)
Browse files Browse the repository at this point in the history
* Update Android dependencies - Wed Apr 19 2023

[Triggered](https://github.com/firebase/firebase-android-sdk/actions/runs/4744622642) by [firebase-android-sdk Apr 19 release](firebase/firebase-android-sdk@0451fa0).

  ### Android

- com.google.android.gms.play_services_ads → 22.0.0
- com.google.firebase.firebase_bom → 31.5.0

> Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/4744629540).

* Firestore: Fix args to AggregateQuerySnapshot constructor (firebase#1277)

* Fix call to AggregateQuerySnapshot constructor

* Fix conflict for coroutines.pro file in google library.

Cherry-picked from firebase#1278 to fix the "More than one file was found with OS independent path 'META-INF/com.android.tools/proguard/coroutines.pro'" error

---------

Co-authored-by: Jon Simantov <[email protected]>

* Update release notes with new versions.

---------

Co-authored-by: firebase-workflow-trigger-bot <[email protected]>
Co-authored-by: Jon Simantov <[email protected]>
Co-authored-by: Denver Coneybeare <[email protected]>
  • Loading branch information
4 people authored Apr 21, 2023
1 parent 5ff343a commit 4318a1d
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def firebaseDependenciesMap = [
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
'firestore' : ['com.google.firebase:firebase-firestore'],
'functions' : ['com.google.firebase:firebase-functions'],
'gma' : ['com.google.android.gms:play-services-ads:21.5.0'],
'gma' : ['com.google.android.gms:play-services-ads:22.0.0'],
'installations' : ['com.google.firebase:firebase-installations'],
'invites' : ['com.google.firebase:firebase-invites'],
// Messaging has an additional local dependency to include.
Expand Down Expand Up @@ -163,7 +163,7 @@ project.afterEvaluate {

// Add the bill-of-materials
project.dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
}
for (String lib : firebaseCpp.dependencies.libSet) {
// Generate and include the proguard file
Expand Down
2 changes: 1 addition & 1 deletion admob/admob_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-ads:19.8.0'
}
Expand Down
2 changes: 1 addition & 1 deletion app/app_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
}

Expand Down
2 changes: 1 addition & 1 deletion app/google_api_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-base:18.2.0'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app/invites_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app_check/app_check_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-appcheck'
}

Expand Down
2 changes: 1 addition & 1 deletion auth/auth_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation project(':app:app_resources')
Expand Down
3 changes: 3 additions & 0 deletions auth/integration_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
}

apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
Expand Down
2 changes: 1 addition & 1 deletion database/database_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-database'
//implementation project(':app:app_resources')
Expand Down
3 changes: 3 additions & 0 deletions database/integration_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
}

apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
Expand Down
2 changes: 1 addition & 1 deletion firestore/firestore_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-firestore'
}
Expand Down
3 changes: 3 additions & 0 deletions firestore/integration_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
}

apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
Expand Down
3 changes: 3 additions & 0 deletions firestore/integration_test_internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
lintOptions {
abortOnError false
}
Expand Down
12 changes: 10 additions & 2 deletions firestore/src/android/aggregate_query_snapshot_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,34 @@ using jni::Env;
using jni::Local;
using jni::Method;
using jni::Object;
using jni::StaticMethod;

constexpr char kClassName[] =
PROGUARD_KEEP_CLASS "com/google/firebase/firestore/AggregateQuerySnapshot";
Constructor<Object> kConstructor(
"(Lcom/google/firebase/firestore/AggregateQuery;J)V");
"(Lcom/google/firebase/firestore/AggregateQuery;Ljava/util/Map;)V");
Method<int64_t> kGetCount("getCount", "()J");
Method<Object> kGetQuery("getQuery",
"()Lcom/google/firebase/firestore/AggregateQuery;");
Method<int32_t> kHashCode("hashCode", "()I");

constexpr char kHelperClassName[] = PROGUARD_KEEP_CLASS
"com/google/firebase/firestore/internal/cpp/AggregateQuerySnapshotHelper";
StaticMethod<Object> kCreateConstructorArg(
"createAggregateQuerySnapshotConstructorArg", "(J)Ljava/util/Map;");

} // namespace

void AggregateQuerySnapshotInternal::Initialize(jni::Loader& loader) {
loader.LoadClass(kClassName, kConstructor, kGetCount, kGetQuery, kHashCode);
loader.LoadClass(kHelperClassName, kCreateConstructorArg);
}

AggregateQuerySnapshot AggregateQuerySnapshotInternal::Create(
Env& env, AggregateQueryInternal& aggregate_query_internal, int64_t count) {
Local<Object> snapshot_data = env.Call(kCreateConstructorArg, count);
Local<Object> instance =
env.New(kConstructor, aggregate_query_internal.ToJava(), count);
env.New(kConstructor, aggregate_query_internal.ToJava(), snapshot_data);
return aggregate_query_internal.firestore_internal()
->NewAggregateQuerySnapshot(env, instance);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.firebase.firestore.internal.cpp;

import com.google.firestore.v1.Value;
import java.util.HashMap;
import java.util.Map;

public final class AggregateQuerySnapshotHelper {
private AggregateQuerySnapshotHelper() {}

/**
* Creates an object appropriate for specifying to the AggregateQuerySnapshot
* constructor that conveys the given "count" as the lone aggregate result.
*
* This class should be deleted and replaced with a proper mechanism once
* SUM/AVERAGE are ported to this SDK.
*/
public static Map<String, Value> createAggregateQuerySnapshotConstructorArg(
long count) {
HashMap<String, Value> map = new HashMap<>();
map.put("count", Value.newBuilder().setIntegerValue(count).build());
return map;
}
}
3 changes: 3 additions & 0 deletions functions/integration_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
}

apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
Expand Down
4 changes: 2 additions & 2 deletions gma/gma_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-ads:21.5.0'
implementation 'com.google.android.gms:play-services-ads:22.0.0'
}

afterEvaluate {
Expand Down
2 changes: 1 addition & 1 deletion messaging/messaging_java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0'
Expand Down
4 changes: 2 additions & 2 deletions release_build_files/Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def firebaseDependenciesMap = [
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
'firestore' : ['com.google.firebase:firebase-firestore'],
'functions' : ['com.google.firebase:firebase-functions'],
'gma' : ['com.google.android.gms:play-services-ads:21.5.0'],
'gma' : ['com.google.android.gms:play-services-ads:22.0.0'],
'installations' : ['com.google.firebase:firebase-installations'],
'invites' : ['com.google.firebase:firebase-invites'],
// Messaging has an additional local dependency to include.
Expand Down Expand Up @@ -136,7 +136,7 @@ project.afterEvaluate {

// Add the bill-of-materials
project.dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
}
for (String lib : firebaseCpp.dependencies.libSet) {
// Messaging includes an aar, which to be depended on properly requires
Expand Down
10 changes: 6 additions & 4 deletions release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ distributed as part of the core Firebase

Feature | Required Libraries and Gradle Packages
-------------------------- | --------------------------------------
All Firebase SDKs | platform(com.google.firebase:firebase-bom:31.3.0)
All Firebase SDKs | platform(com.google.firebase:firebase-bom:31.5.0)
| | (Android Bill of Materials)
Firebase AdMob | libfirebase_admob.a
| (deprecated) | libfirebase_app.a
Expand Down Expand Up @@ -133,7 +133,7 @@ Google Mobile Ads | libfirebase_gma.a
| | libfirebase_app.a
| | com.google.firebase:firebase-analytics
| | (Maven package)
| | com.google.android.gms:play-services-ads:21.5.0
| | com.google.android.gms:play-services-ads:22.0.0
| | (Maven package)
Firebase Installations | libfirebase_installations.a
| | libfirebase_app.a
Expand All @@ -146,7 +146,7 @@ Firebase Messaging | libfirebase_messaging.a
| | com.google.firebase:firebase-messaging
| | (Maven package)
| | libmessaging_java.jar (Android service)
| | androidx.core:core:1.9.0 (Maven package)
| | androidx.core:core:1.10.0 (Maven package)
Firebase Realtime Database | libfirebase_database.a
| | libfirebase_auth.a
| | libfirebase_app.a
Expand Down Expand Up @@ -643,8 +643,10 @@ code.

## Release Notes
### Upcoming Release
- 10.8.0
- Changes
- General (iOS): Update to Firebase Cocoapods version 10.8.0.
- General (Android): Update to Firebase Android BoM version 31.5.0.
- GMA (Android): Updated dependency to play-services-ads version 22.0.0.
- Firestore: Added `Query::Count()`, which fetches the number of documents in the result
set without actually downloading the documents
([#1207](https://github.com/firebase/firebase-cpp-sdk/pull/1207)).
Expand Down
3 changes: 3 additions & 0 deletions storage/integration_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ android {
proguardFile file('proguard.pro')
}
}
packagingOptions {
pickFirst 'META-INF/**/coroutines.pro'
}
}

apply from: "$gradle.firebase_cpp_sdk_dir/Android/firebase_dependencies.gradle"
Expand Down
2 changes: 1 addition & 1 deletion storage/storage_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:31.3.0')
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-storage'
}
Expand Down

0 comments on commit 4318a1d

Please sign in to comment.