-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
bug: The default Firebase app has not yet been configured. Add FirebaseApp.configure() to your application initialization. #752
Comments
It's definitely possible to record custom traces and we use it ourselves. It seems like you did not follow the setup guide correctly since it's not needed to import any Firebase packages via Xcode yourself. Please provide a Minimal, Reproducible Example so that I can debug your issue. |
This issue has been labeled as Please provide a Minimal, Reproducible Example using this template in a public GitHub repository so we can debug the issue. If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for us to reproduce the issue. |
Hello, Originally, I needed only FirebaseMessaging, FirebasePerformance, and Crashlytics, so I added firebase-ios-sdk version 10.25.0 directly in Xcode using the 'Add Package' feature, enabling only the necessary services. This setup has worked well. However, I recently needed to add custom traces to Performance Monitoring, which requires implementing trace code within my Ionic project. Therefore, I installed @capacitor-firebase/performance version 6.1.0 to add the trace functionality. In this scenario, should I remove the firebase-ios-sdk from Xcode and rely entirely on the @capacitor-firebase package suite? Or is there any way to allow firebase-ios-sdk and @capacitor-firebase/performance to coexist smoothly? Thank you! |
You need to remove the firebase-ios-sdk from Xcode. |
Currently, since I need to use logEvent() and setUserProperty() for Analytics, I've kept firebase-ios-sdk in Xcode. With this setup, I've also installed @capacitor-community/firebase-analytics in the Ionic project and am successfully calling functions like FirebaseAnalytics.logEvent()—so they coexist without issues. However, migrating entirely to capacitor-firebase would be a significant task. I’d like to confirm if there’s any way to have both firebase-ios-sdk and @capacitor-firebase/performance coexist. If it’s truly not possible, I’ll need to reconsider whether to implement this functionality. Thanks! |
At least it is not officially supported by these plugins and it has never been tested. The advantage of this repository is that you don't have to worry about the versioning of the Firebase SDK. It is ensured that all plugins are compatible with each other. |
Got it, I’ll carefully reconsider whether to fully switch to the capacitor-firebase plugins. Thank you very much for your help! |
Plugin(s)
Version
6.1.0
Platform(s)
Current behavior
using @capacitor-firebase/performance (v6.1.0), but whenever I call FirebasePerformance.startTrace(), the app crashes with the message, "The default Firebase app has not yet been configured. Add FirebaseApp.configure() to your application initialization."
Expected behavior
no crash and successfully collect custom trace data to PerformanceMonitoring dashboard
Reproduction
https://github.com/capawesome-team/capacitor-firebase
Steps to reproduce
I’m using firebase-ios-sdk (v10.25.0) in Xcode and have enabled FirebasePerformance. It has been working for a while, and I can see auto-collected performance data in the Firebase console. Now, I’d like to add custom traces. I tried using @capacitor-firebase/performance (v6.1.0), but whenever I call FirebasePerformance.startTrace(), the app crashes with the message, "The default Firebase app has not yet been configured. Add FirebaseApp.configure() to your application initialization."
I also tried using the 'firebase/performance' package on the backend. There was no error, and I could see API logs following the official Firebase debugging method. However, the API response returned:
{
"nextRequestWaitMillis": "10000",
"logResponseDetails": [
{
"responseAction": "DELETE_REQUEST"
}
]
}
I've been stuck on this issue for several days. Does anyone know what I might be doing wrong, or is it currently impossible to record custom traces in Firebase Performance Monitoring with Capacitor?
Other information
No response
Capacitor doctor
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2
Installed Dependencies:
@capacitor/cli: 6.0.0-rc.0
@capacitor/core: 5.6.0
@capacitor/android: 5.6.0
@capacitor/ios: 5.6.0
[success] iOS looking great! 👌
[success] Android looking great! 👌
Before submitting
The text was updated successfully, but these errors were encountered: