Skip to content

Application startup time not reported when initializing FIrebaseApp manually #4759

@louisbeaujeu

Description

@louisbeaujeu

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Electric Eel | 2022.1.1 Patch 2
  • Firebase Component: Performance
  • Component version: 20.3.1

[REQUIRED] Step 3: Describe the problem

Since version 20.3.1 it seems that Firebase Performance does not report the application startup time if Firebase is manually initialized.
Probably due to this check in FirebasePerfEarly:

As StartupTime is not initialized if Firebase is manually instantiated

// Don't provide StartupTime in direct boot mode or if Firebase was manually started

Steps to reproduce:

Disable FirebaseInitProvider and initialize Firebase in code with FirebaseApp#initializeApp(context), the App startup time won't be reported on Firebase Dashboard

Activity

changed the title [-]Application startup time not report when initializing FIrebaseApp manually api: performance type: bug [/-] [+]Application startup time not report when initializing FIrebaseApp manually[/+] on Mar 8, 2023
changed the title [-]Application startup time not report when initializing FIrebaseApp manually[/-] [+]Application startup time not reported when initializing FIrebaseApp manually[/+] on Mar 8, 2023
argzdev

argzdev commented on Mar 10, 2023

@argzdev
Contributor

Thanks for reporting, @louisbeaujeu. I was able to reproduce the same behavior. I'll notify our engineers and see what we can do here.

louisbeaujeu

louisbeaujeu commented on Apr 17, 2023

@louisbeaujeu
Author

Thanks for the response ! Any update on this issue ?

argzdev

argzdev commented on Apr 17, 2023

@argzdev
Contributor

Hi @louisbeaujeu, sorry for the radio silence. Our engineers are currently working on other issues at the moment. However, rest assured that this is being investigated and worked on.

That said, I'd like to ask for a favor for anyone else that encounters the same issue to kindly leave a thumbs up on the author's original post. This'll help us prioritize issues based on severity and demand. Thanks!

ganadist

ganadist commented on Oct 6, 2023

@ganadist
Contributor

In my case, I want to measure app startup time with Firebase Perf.
But by this issue, I have a concern whether my app comply with legal compliance requirements such as GDPR.

muhammad-darmawan

muhammad-darmawan commented on Oct 22, 2024

@muhammad-darmawan

Hi, any update on this issue?
Thanks

exaby73

exaby73 commented on Oct 29, 2024

@exaby73
Contributor

Hello @louisbeaujeu. I am unable to reproduce this issue with the latest BOM. Can you provide me some sample code that you can confirm reproduces this issue?

SimonMarquis

SimonMarquis commented on Oct 29, 2024

@SimonMarquis

@exaby73 the code still relies on this FirebaseInitProvider.isCurrentlyInitializing() call:

// Don't provide StartupTime in direct boot mode or if Firebase was manually started
if (UserManagerCompat.isUserUnlocked(applicationContext)
&& FirebaseInitProvider.isCurrentlyInitializing()) {
builder.addComponent(Component.of(startupTime, StartupTime.class));
}

which is a static private variable:

@NonNull private static AtomicBoolean currentlyInitializing = new AtomicBoolean(false);

modified only in FirebaseInitProvider.onCreate()

public boolean onCreate() {
try {
currentlyInitializing.set(true);
if (FirebaseApp.initializeApp(getContext()) == null) {
Log.i(TAG, "FirebaseApp initialization unsuccessful");
} else {
Log.i(TAG, "FirebaseApp initialization successful");
}
return false;
} finally {
currentlyInitializing.set(false);
}
}

... so, nothing has changed since, and the issue is still present.

Here is how to reproduce this:

Disable FirebaseInitProvider and initialize Firebase in code with FirebaseApp#initializeApp(context), the App startup time won't be reported on Firebase Dashboard

google-oss-bot

google-oss-bot commented on Nov 5, 2024

@google-oss-bot
Contributor

Hey @louisbeaujeu. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

SimonMarquis

SimonMarquis commented on Nov 5, 2024

@SimonMarquis

@exaby73 what do you need exactly?

Do you need a basic Android project with this?

FirebaseInitProvider and initialize Firebase in code with FirebaseApp#initializeApp(context)

'cause it is fairly trivial to do on its own, and it will probably not be that useful since we already outlined the exact issue here.

google-oss-bot

google-oss-bot commented on Nov 12, 2024

@google-oss-bot
Contributor

Hey @louisbeaujeu. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

SimonMarquis

SimonMarquis commented on Nov 12, 2024

@SimonMarquis
google-oss-bot

google-oss-bot commented on Nov 19, 2024

@google-oss-bot
Contributor

Hey @louisbeaujeu. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

SimonMarquis

SimonMarquis commented on Nov 19, 2024

@SimonMarquis
google-oss-bot

google-oss-bot commented on Nov 26, 2024

@google-oss-bot
Contributor

Hey @louisbeaujeu. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Lyokone

Lyokone commented on Dec 10, 2024

@Lyokone

Moving to feature request, since the intended behavior is working.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ganadist@SimonMarquis@Lyokone@google-oss-bot@exaby73

        Issue actions

          Application startup time not reported when initializing FIrebaseApp manually · Issue #4759 · firebase/firebase-android-sdk