PROBLEMS WITH FIREBASE: Realtime Database and Firestore - App Not Launching! Need Help!

Hello colleagues,

I decided to create an application where users need to register and then log in. I implemented this functionality using Firebase Auth, and it works. However, a problem arose when I needed to assign each user a status (user, vip, premium) and record this in the database. According to my logic, after registration, the application receives the assigned UID of the user and then writes information about this user (username, status, expiration date of the status) into the Realtime Database using this UID.

However, the issue occurred when I tried to add the Firebase Database component to my project. With this component included, the compiled application closes immediately without any errors. I tried setting different values in the properties and even leaving them empty, as well as initializing the values directly in the initialization blocks, but nothing changed, and the application still closes immediately. I created a new empty project and added only two components: Firebase Core and Firebase Database, and the result was the same; the application closed again.

I took a different approach and used Firestore Database instead. In the project, I added the Firestore component, initialized it with the correct data in the initialization blocks, compiled the application, and upon launch, it now throws an error: “Runtime Error FirebaseApp with name second app doesn’t exist. Available app names: [DEFAULT]”. I don’t understand what this error means.

Please forgive me for the long message. I tried to explain the situation in detail.

Block Images(if Any)



Could you please provide the device logs? This will help us easily identify the underlying issue.

I tried to copy the log of exactly what happens during the application startup into a text file.

The first log is from a plain text application with added Firebase Core and Firebase Database components, which closes immediately after launching without any errors.
logFirebase Database.txt (196.1 KB)

The second log is from my application with Firestore, where the error I mentioned above occurs.
logFirestore.txt (278.0 KB)

I continue to search for the causes of the errors and crashes. Here is what I managed to discover: If I add the google-services.json file downloaded from Firebase to the Assets folder and set UseJsonFile = false in the Firebase Core component, the error “FirebaseApp with name second app doesn’t exist. Available app names: [DEFAULT]” does not occur at startup. However, when using Firestore, specifically the GetAllDocs block, the application crashes again, i.e., it closes without any errors. I studied how to use the ADB utility a bit more and recorded new logs.

New log of the application using Firestore and crashing when the GetAllDocs block is executed:
firestore_app_logs.txt (324.2 KB)

New log of the application using Firebase Database and crashing at startup:
firebasdb_app_logs.txt (76.8 KB)

1 Like

Thanks for the helpful logs and debug info. Will release an update with the fix

how to access project bucket in new update

You don’t need project bucket, Just provide your bucket at the beginning of the tag.

If your bucket name earlier was Test and you are getting the value abcd.

Now you can get that same value using the tag Test/abcd

Beyond the hassle of having to write the entire tag(path), I still can’t figure out how to handle the type of data returned.

“”{1701={price=4, name=Pedro, stock=9}, 1700={price=5, name=Gaston, stock=10}, 1704={other={rate=23, comment=For sale}, price=9, name=Sony, stock=0}, 1703={price=3, name=Franco, stock=7}, 1702={other={rate=43, comment=Best product 2024}, price=3, name=Franco, stock=7}}“”

It would be very helpful if someone could provide examples.
Until then we will have to resort to patch (aix) to overcome the problems. :face_with_raised_eyebrow:

And I repeat, the companion is impossible to use, it constantly refreshes and makes it impossible to evaluate variables because they are lost with each restart.

I also don’t understand why, with a BETA test version, they decided to break everything, or not give time to debug and be able to migrate progressively.

I apologize for all my complaining, but I’m really disappointed. I know it will be resolved soon, but that’s not the way it should be. Many of us ended up here because of that kind of thing.

Are you testing this in the beta or main version? In the beta version you should be getting the value as a dictionary type

Now companion 4.9.11 works in Beta and GotValue returns a dictionary, I saw that changes were made to components, such as GotTagList.

The screen update issue when moving any block or execution has not yet been resolved.
Note: This only occurs with projects or screens that have Firebase components.

1 Like