Why FirebaseDB component is not working in localhost?

Today, I created an app using FirebaseDB in appinventor(running locally). but it crashed when I open it in a device. Have someone faced this issue ? Is this a bug or I am not using it correctly ? I created another project with only FirebaseDB component. this is also crashing.

Show your blocks and Firebase settings.

1 Like

Screenshot (219)

I used no blocks

  1. Remove the FirebaseToken, just leave it empty
  2. Internet connection required for Firebase
  3. Ensure your Firebase project is using the US server

Thanks for your reply @TIMAI2

Then, how will I access the data from database ?

My pc and phone both are connected to a strong wifi.

In Appinventor online, FirebaseDB works for me. And in localhost, its not working. How can I use the US server ? Using a VPN ?

Then, how will I access the data from database ?

Usually just works. However, if you must, ensure you are using the API key from the project

You would need to create a new Firebase project

Your alternative is to use the web component and the Firebase REST api

1 Like

Yes, I confirm that.
I tested it on my Pixel 4XL (Android 12) with the APK built with the current version of AI2Offline (v4.5.4).
@Ramiro

1 Like

@Anke , This is not only happens in Ai2Offline but also in Appinventor(running locally). There is a code in MockFirebaseDB which enters the FirebaseToken inside FirebaseDB component when dropped to Viewer. The generated token is related to firebase authentication . In offline, its not generating because the server is either not online or not using firebase for authentication.

Sir @ewpatton, please have a look here

Something similar happens with the Translator component on the local server, when dragging it to the designer an error occurs, an "empty key".

1 Like

Means a app with Translator component also crashes ?

There is no Transaltor component in AI2Offline (v4.5.4) - right AI2 (online):

But when I import a project with this component from AI2 online, there is no problem with AI2Offline.

The only way for the translation to work in the apk is to copy the ApiKey from the online version to the local version, however there is another problem, if you log out when you start again the ApiKey field will be empty.

Edit. Well I think I found a way.

1 Like

Thanks @anke and @Ramiro. But I am using FirebaseDB component. Do you know any solution for it ?


I guess you have to modify these lines, but I've never tried

1 Like

Thanks @Ramiro , I will try it.

Yes, I did it exactly this way. But as I said, there is no Translator component in the Media section.
You have to get it this way:

1 Like

Modify to what?

1 Like

So what is your question?
Do you see this component in AI2Offline (current version)?
If so, take a screenshot and post it. (I want to see it with my own eyes. :wink:)

Spelling error

If there are no other problems...

1 Like