Android initialization problem

1,129 views
Skip to first unread message

Chris Sorrell

unread,
Dec 4, 2019, 7:35:51 PM12/4/19
to Firebase Google Group
Hi,

Our app has to determine which Firebase database to use at runtime and so having credentials built into the app isn't something that helps us. We have worked around this in our desktop and iOS builds, but with Android initialization is automatic and I can't seem to find any way to know when it is complete or ideally how to stop that!

This means that we see 'InvalidOperationException: Don't call other Firebase functions while CheckDependencies is running' when the app runs and I can't find any way to get around this.


...But having set up the manifest as suggested I'm not seeing any change - obviously the build process has failed to remove the Init() call for some reason.

Unfortunately I'm no Android build systems expert, and additionally our project is Unity based making the exact build process even more opaque. However, I have confirmed (in Unity's Temp/StagingArea folder) that the manifest passed on from Unity has the 'tools:node="remove"' stuff detailed in the article.

Can anyone offer a solution? Or is there at least a way to check whether CheckDependencies has completed?

Many thanks,

Chris

Shawn Kuang

unread,
Dec 6, 2019, 11:34:16 PM12/6/19
to Firebase Google Group
Hi Chris,

The best way to determine if CheckDependencies is finished is to just use continuation function.

You can use the default ContinueWith() from Task or our extension method ContinueWithOnMainThread()

Or if you are using .NET 4.x, you can also design a async function and use await.

Hope this helps!

Shawn
Reply all
Reply to author
Forward
0 new messages