Class Conflict between two Firebase modules.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- android, firebase, java
- 領域
- build-system, mobile
調査の方向性
Issue に示されているアプリレベルの Gradle 依存関係から始め、firebase-admin アーティファクトと firebase-messaging アーティファクトを、リンク先の Cloud Messaging チュートリアルと比較します。重複する com.google.firebase.messaging パッケージなしで両方のモジュールが共存できるかを確認します。文書化された依存関係の設定で FirebaseMessaging が解決され、チュートリアルの sendMulticast API が公開されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Environment
This is currently the dependencies used in my app-level Gradle build script
dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.navigation:navigation-fragment:2.7.5")
implementation("androidx.navigation:navigation-ui:2.7.5")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
implementation("com.google.firebase:firebase-admin:9.2.0")
implementation("com.google.firebase:firebase-messaging:23.4.0")
}
Description
TL;DR: firebase-admin and firebase-messaging has the same classpath com.google.firebase.messaging.*, but their class's content is totally different.
Currently, I want to use both the module firebase-admin and firebase-messaging to learn about the feature Cloud Messaging, so I have installed my dependencies as above. The issue arose when I wanted to import the class FirebaseMessaging.
// Create a list containing up to 500 registration tokens.
// These registration tokens come from the client FCM SDKs.
List<String> registrationTokens = Arrays.asList(
"YOUR_REGISTRATION_TOKEN_1",
// ...
"YOUR_REGISTRATION_TOKEN_n"
);
MulticastMessage message = MulticastMessage.builder()
.putData("score", "850")
.putData("time", "2:45")
.addAllTokens(registrationTokens)
.build();
BatchResponse response = FirebaseMessaging.getInstance().sendMulticast(message);
// See the BatchResponse reference documentation
// for the contents of response.
System.out.println(response.getSuccessCount() + " messages were sent successfully");
While I was following [this tutorial] (https://firebase.google.com/docs/cloud-messaging/send-message#send-messages-to-multiple-devices) to build a send request to multiple devices, my IDE could not resolve the method sendMutlicast()
It turned out that while the imported class was com.google.firebase.messaging.FirebaseMessaging, the class was from the module firebase-messaging , which did not contain any of useful send method, rather than firebase-admin.
Is there anyway I can import the class FirebaseMessaging from firebase-admin and still keeping the two modules? I had switching the import order in Gradle file but still to no avail.
Thank you very much!
- 主要言語
- Java
- スター
- 620
- フォーク
- 305
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-java のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
firebase/firebase-admin-java#1231 ·
-
api: core
firebase/firebase-admin-java#1198 · コメント 3 件 · 担当者 1 名 ·
-
api: remoteconfig
firebase/firebase-admin-java#1196 · コメント 1 件 · 担当者 2 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
firebase/firebase-admin-java#1192 · コメント 3 件 ·
-
needs-triage type: feature request
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
firebase/firebase-admin-java#1149 · コメント 1 件 ·
firebase/firebase-admin-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/gradle-plugins#157 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cryptomator/hub#497 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
johanhaleby/occurrent#1120 ·