Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

java - Firebase Database points to wrong database URL

I am working on an Android app and trying to use Firebase Database. I tried to write data to the Database but nothing was showing up (checked via Firebase console). I have Firebase libraries in the build:

implementation platform('com.google.firebase:firebase-bom:26.2.0')
implementation 'com.google.firebase:firebase-database'

My Firebase Database URL as per Firebease console is :

    https://xxxxxxxx-xxxxxxx-default-rtdb.europe-west1.firebasedatabase.app/

whereas when I get a reference to it from the code:

    private DatabaseReference mDatabase;

    mDatabase = FirebaseDatabase.getInstance().getReference();
    Log.i(TAG," Reference is: "+mDatabase.toString());

The logcat shows below response:

    I/Tag:  Reference is: https://xxxxxxxx-xxxxxxx-default-rtdb.firebaseio.com

I also have the google-services.json file in the project which points to the same database URL shown in the Firebase console. It appears to me that Firebase has misconfigured my database somewhere which I can't see / configure.

Is there anything I am missing?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...