-
Notifications
You must be signed in to change notification settings - Fork 1.6k
import Firebase is not sufficient to define the FirebaseApp symbol in my build environment. #6341
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
Comments
I found a few problems with this issue:
|
Some additional info: When the code has "import FirebaseCore" and just after performing a 'Clean Build Folder', Xcode complains "No such module Firebase". However, that error is cleared upon running a build and both the QuickStart app and my app seem to work fine with the 'import FirebaseCore'. See Screenshot. |
The I appreciate the detailed steps, but still wasn't able to reproduce the Two additional questions:
|
Another quick update: After restarting Xcode 11.5 on the machine which I previously reported was working, the error "use of unresolved identifier 'FirebaseApp'..." is now happening on that machine. The upgrade from Firebase 6.27.0 to 6.31.0 was done on that machine and then shared with the Xcode 11.6 machine through git. The Xcode 11.5 machine was able to build fine until the restart of Xcode. Thanks for following up @paulb777. Yes, the unresolved identifier issue also happens when I build for a simulator (iPad Pro 4th gen iOS 13). $ pod --version |
More info: Sometimes the build succeeds without having to import FirebaseCore. Even when the build succeeds, Xcode still complains about the use of unresolved identifiers, but the build succeeds and the app launches. I haven't determined a reliable pattern that ensures a the build with succeed (nor one that ensures failure). I've messed with things like building with FirebaseCore imported, then removing it and rebuilding. I've messed with running a clean build or not. In my own project, I don't have a consistent pattern, but I do see a fairly consistent pattern in the QuickStart project: In the QuickStart project, without any modification to the code, it fails to perform a clean build in Debug, but succeeds and runs when running a clean build in Release. Xcode still reports the errors, but the build succeeds in Release. |
Thanks for the continued investigation. It really sounds like something non-deterministic is going on. Separate from the Xcode complaints, does a clean build ever fail? |
Yes, a clean build fails (unless I import FirebaseCore). Sorry if my previous comment wasn't clear. Most builds fail. My main goal was to convey that sometimes a build will succeed even though Xcode continues to complain. I haven't yet determined a reliable pattern to this. I've updated my previous comment to make it more direct. |
I think you have a good theory. The build fails in just a few seconds, so the 1 minute granularity of the hover timestamp may not be revealing, but I included a screenshot below. Given that I am intermittently able to coax a successful build out of it, I think there may be some left over state from a previous build, combined with something like a race condition like you theorized that may be interacting and leading to the intermittent success. Does your build succeed with Xcode 11.6, using the Debug configuration, following a clean build? That has never built successfully for me with the AnalyticsExample project from QuickStart, using Firebase 6.31.0. |
Yep, it always succeeds for me. I haven't been able to reproduce. However, I'm still on 10.15.5 so it might be exposed by 10.15.6 Just the fact that your log shows the app build before building FirebaseCoreDiagnostics is concerning since FirebaseCoreDiagnostics is a dependency of FirebaseCore ... |
Here are three screen shots of the build log. The first with the Debug configuration, which failed. The next two with the Release configuration, which succeeded. The different components show up in a different order across the two builds. I can't tell if this is relevant. |
I'm wondering if https://github.com/firebase/firebase-ios-sdk/pull/5884/files exposed this. Does it make a difference if you go back to a Firebase version before that change like 6.27.0? |
I had been using 6.27.0 prior to this week without any issues. |
@canfieldtim Thanks for all of your help tracking this down! I'm hopeful that #6367 will be a fix. |
Firebase 6.31.1 is now published on CocoaPods with the fix. |
@paulb777 This seems to fix it and things build as expected with 6.31.1 in my environment. Thanks! |
@canfieldtim Thanks for confirming and thanks again for the assistance tracking it down! |
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
'import Firebase' is no longer sufficient to define the FirebaseApp symbol in my build environment. Using Xcode 11.6, with Firebase 6.31.0, I have to import FirebaseCore to avoid getting: "error: use of unresolved identifier 'FirebaseApp'". I was previously using Firebase 6.27.0 on this same build machine without issue when only importing Firebase.
I believe this is the same issue as #6066. The comments in that issue indicate that 'import Firebase' should be sufficient and that importing the specific component (or firebase core) is not needed. I have run through the proposed resolution in that issue (quit Xcode, remove pods dir, remove xcworkspace dir, rerun pod install, open newly created xcworkspace). This does not resolve the issue in my project.
I am able to reproduce the same issue with the QuickStart sample for analytics.
This problem does not occur on my other build machine, which has the same firebase environment, but is running Xcode 11.5 (11E608c) on macOS 10.15.4 (19E266).
Steps to reproduce:
Reproducible with QuickStart sample:
$ git clone https://github.com/firebase/quickstart-ios.git
$ cd quickstart-ios/analytics/
$ pod install --repo-update
$ open AnalyticsExample.xcworkspace
Building with the Debug configuration for physical device running iOS 13 produces:
Relevant Code:
From QuickStart sample/analytics/AnalyticsExample/AppDelegate.swift:
The text was updated successfully, but these errors were encountered: