firebase-ios-sdk: Build error in FirebaseCoreDiagnostics >= 7.2.0
Step 0: Are you in the right place?
- For issues or feature requests related to the code in this repository
file a Github issue.
- If this is a feature request please use the Feature Request template.
- For general technical questions, post a question on StackOverflow
with the
firebase
tag. - For general (non-iOS) Firebase discussion, use the firebase-talk google group.
- For backend issues, console issues, and other non-SDK help that does not fall under one of the above categories, reach out to Firebase Support.
- Once you’ve read this section and determined that your issue is appropriate for this repository, please delete this section.
[REQUIRED] Step 1: Describe your environment
- Xcode version: 12.2
- Firebase SDK version: 7.1.0, 7.2.0
- Installation method: CocoaPods
- Firebase Component: FirebaseCoreDiagnostics dependents (Auth, InAppMessaging, RemoteConfig etc)
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
I think there may be two issues, related. Both have the same ultimate build error
- Pod dependency issues:
When 7.1.0 was originally released, everything built fine. Now with 7.2.0 out, 7.1.0 no longer builds correctly.
I believe some of the podspecs allow a few of the transitive dependencies to slip the bonds of the requested version (7.1.0) and move to 7.2.0. Specifically, these pods will go to 7.2.0 on a fresh install of 7.1.0 Firebase/*
pods - here’s a snippet from where I was pinning them in my test app Podfile to see what Podfile.lock would look like - each would go to 7.2.0 (or 7.2.0-beta for FirebaseMLCommon) despite a request for the related 7.1.0 Pods (e.g. 'Firebase/InstanceID', $FirebaseSDKVersion
with 7.1.0 would get me `FirebaseInstanceID of 7.2.0. In fact, this seems to happen even if I try 7.0.0 now because it is still semver compatible with 7.2.0 according to the version constraints.
#pod 'FirebaseABTesting', $FirebaseSDKVersion
#pod 'FirebaseCoreDiagnostics', $FirebaseSDKVersion
#pod 'FirebaseInstallations', $FirebaseSDKVersion
#pod 'FirebaseInstanceID', $FirebaseSDKVersion
#pod 'FirebaseMLCommon', "#{$FirebaseSDKVersion}-beta"
- Build error in FirebaseCoreDiagnostics >= 7.2.0
❌ /Users/mike/work/Invertase/react-native-firebase/tests/ios/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m:20:9: 'GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h' file not found
#import "GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Normally I would trust the internal versioning to be okay, but in this case the rest of the internal 7.2.0 changes are fine except FirebaseCoreDiagnostics. That one has a build error as above.
When I try to use 7.2.0 completely - which I was testing after fixing a firestore compile issue this morning - it still fails.
I maintain a fully scripted react-native-firebase demonstrator where you can see how we construct a clean project and add our dependencies, then investigate the resulting Podfile - it fails to compile now with 7.x.x
https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh
You’ll need node + yarn installed to run it, plus a ‘GoogleServices-plist.json’ and ‘google-services.json’ to your favorite example project (they’re unused unless you run the demo and even then the demo doesn’t actually do anything other than prove it builds and runs, if you’re curious)
I’m not sure what the root cause of the error is but I reproduce it in FlutterFire (where I’m trying to get firebase-ios-sdk >=7 supported - https://github.com/FirebaseExtended/flutterfire/pull/4249), my work app, and react-native-firebase which I maintain and normally know what I’m doing, except when a hit a build error and feel lost 😉. Our test app no longer works unless I use 7.1.0 and in our app Podfile pin FirebaseCoreDiagnostics to 7.1.0
Help?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (23 by maintainers)
Found it. Corrupt local cocoapods cache.
Caught me out despite some history with pod local state learnt while helping others fix build errors
Never seen this cache go corrupt before.
So frustrating!
I was aware of
~/.cocoapods
but not of~/Library/Caches/CocoaPods
- found it referenced here https://guides.cocoapods.org/using/troubleshooting and investigated7.1.0 is correct, 7.2.0 on this machine is for some reason incomplete, and looking in the Library cache is where it is visible.
cd ios && pod cache clean --all && rm -fr Pods
purges everything from cache and my project install,pod install
results in sanity(I suppose you could snipe it with
pod cache clean FirebaseCoreDiagnostics --all
to get just that pod but all versions but I didn’t trust it)Quite a time-costly piece of wisdom re: pods picked up right there.
@mikehardy Appreciate the heads-up. I’ll take a look this afternoon.