Error after initializing Firebase (SOLVED)

Hi there,

I’m trying to add Firebase to my game, but I got the following error in the console.

ERROR:SCRIPT: /main/main.script:26: attempt to index global ‘firebase’ (a nil value)
stack traceback:
/main/main.script:26: in function </main/main.script:12>
Extension firebase is not supported

I understand that the Defold simulator doesn’t support the Firebase extension and that I have to test it directly on the device, my concern is about the “attempt to index global ‘firebase’ (a nil value)” part. Am I initializing firebase correctly?

I’m doing the following in my main collection

function init(self)
    firebase.init()
end

Thanks :slight_smile:

Have you added the dependency to the project? (documentation)

After doing so, choose “Fetch Libraries” from the menu in the editor.
You should see a new folder in the project view to the left.
Then bundle your game for your device (we’ll build the custom engine for you).
After a succesful build, the engine runtime will have a Lua namespace called firebasewhich will not be nil.

2 Likes

Thanks Mathias,

I already managed to connect Firebase to iOS.

Cheers!

1 Like