第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Firestore 憑據(jù)問(wèn)題:Firebase 應(yīng)用 [默認(rèn)] 已存在

Firestore 憑據(jù)問(wèn)題:Firebase 應(yīng)用 [默認(rèn)] 已存在

Cats萌萌 2023-06-14 14:29:18
我正在用 JavaFX 構(gòu)建一個(gè)簡(jiǎn)單的程序,用于將 .xls 文件上傳到我的 firebase/firestore 項(xiàng)目。每次我嘗試運(yùn)行該程序并單擊一個(gè)按鈕來(lái)初始化我的上傳器類(lèi)時(shí),它都會(huì)失敗并顯示一條錯(cuò)誤消息:FirebaseApp 名稱(chēng) [DEFAULT] 已經(jīng)存在!找了半天,還是沒(méi)找到有用的。我已經(jīng)嘗試過(guò) OAuth2 令牌(在 Google Cloud 中創(chuàng)建了一個(gè)服務(wù)帳戶(hù),獲得了 JSON 文件)、環(huán)境變量(不會(huì)檢測(cè)到),以及文檔中的幾乎所有內(nèi)容。  FileInputStream serviceAccount = new FileInputStream("<path>.json");FirebaseOptions options = new FirebaseOptions.Builder()        .setCredentials(GoogleCredentials.fromStream(serviceAccount))        .setDatabaseUrl("https://<project>.firebaseio.com/")        .build();    FirebaseApp.initializeApp(options); <----This line won't compile for some reason..Firebase app =FirebaseApp.initializeApp(options); <--------- This will compile我正在使用 Gradle 作為我的構(gòu)建工具。這是我到目前為止所得到的,它似乎可以很好地構(gòu)建而沒(méi)有問(wèn)題。我是否缺少任何依賴(lài)項(xiàng)? plugins {    id 'java'    id 'org.openjfx.javafxplugin' version '0.0.8'    id 'application'}version '1.0-SNAPSHOT'sourceCompatibility = 1.8repositories {    mavenCentral()    jcenter()    google()}dependencies {    testCompile group: 'junit', name: 'junit', version: '4.12'    compile "org.apache.poi:poi:3.17"    compile "org.apache.poi:poi-ooxml:3.17"    implementation 'com.google.firebase:firebase-auth:18.1.0'    implementation 'com.google.firebase:firebase-admin:6.9.0'    implementation 'com.google.firebase:firebase-firestore:20.2.0'    compile 'com.google.firebase:firebase-admin:6.9.0'}javafx {    version = '12'    modules = ['javafx.controls', 'javafx.fxml']}mainClassName = 'app.Main'apply plugin: 'org.openjfx.javafxplugin'
查看完整描述

1 回答

?
慕妹3242003

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超6個(gè)贊

您不能firebase-admin與其他 Firebase Android 庫(kù)一起使用,例如firebase-authfirebase-firestore。您應(yīng)該使用 Admin SDK 或 Android SDK,但絕不能同時(shí)使用兩者。

來(lái)到確切的錯(cuò)誤消息,這表明initializeApp()在您的應(yīng)用程序中被多次調(diào)用。它正在嘗試初始化[DEFAULT], 當(dāng)一個(gè)已經(jīng)存在時(shí)。


查看完整回答
反對(duì) 回復(fù) 2023-06-14
  • 1 回答
  • 0 關(guān)注
  • 150 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)