Skip to content

FirebaseAI.getInstance(FirebaseApp) StackOverflowException #6971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emilypgoogle opened this issue May 20, 2025 · 0 comments
Open

FirebaseAI.getInstance(FirebaseApp) StackOverflowException #6971

emilypgoogle opened this issue May 20, 2025 · 0 comments
Assignees

Comments

@emilypgoogle
Copy link
Collaborator

Bug

When calling FirebaseAI.getInstance(FirebaseApp), any app will crash with a StackOverflowException because the method calls itself.

Offending code snippet: https://github.com/firebase/firebase-android-sdk/blob/main/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt#L223

Workaround

This can be avoided by simply calling FirebaseAI.getInstance(FirebaseApp, GenerativeBackend) and explicitly specifying the backend, or, if using the default app, FirebaseAI.instance/FirebaseAI.getInstance() will also work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants