Skip to content
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

[firebase 3.2.x] Android "default FirebaseApp is not initialized" #243

Open
tommag21 opened this issue Mar 4, 2024 · 1 comment
Open

Comments

@tommag21
Copy link

tommag21 commented Mar 4, 2024

CLI: 8.6.5
@nativescript/core: 8.6.2
@nativescript/firebase-analytics: 3.2.2
@nativescript/firebase-core: 3.2.2
@nativescript/firebase-crashlytics: 3.2.2
@nativescript/firebase-messaging: 3.2.2

Were there any breaking changes in the latest versions of firebase-core analytics, crashlytics or messaging? After updating from version 3.1.3 to version 3.2.2 or 3.2.0, I get this error on Android devices:
Error: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.myapp.myapp. Make sure to call FirebaseApp.initializeApp(Context) first.

My code, unchanged from the previous version. initializeApp() returns null and the next line throws the exception.

import { firebase } from "@nativescript/firebase-core";
import "@nativescript/firebase-analytics";
import "@nativescript/firebase-crashlytics";
import "@nativescript/firebase-messaging";

export async function initFirebase() {
    const app = await firebase().initializeApp();
    // app is null

    firebase().crashlytics().setCrashlyticsCollectionEnabled(true);
}

Downgrading to version 3.1.3 all works fine.

@tommag21 tommag21 changed the title [firebase] Android "default FirebaseApp is not initialized" [firebase 3.2.x] Android "default FirebaseApp is not initialized" Mar 4, 2024
@kefahB
Copy link
Contributor

kefahB commented Mar 4, 2024

Hi,

Downgrade the google firebase lib from the firebase-core/platforms/android/build.grale to 3.8 I think.

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

No branches or pull requests

2 participants