iosxcodefirebasecocoapodsnativescript

ld: framework not found FirebaseAuth error due to residual firebase components


I'm using firebase authentication, messaging, and realtime database in my nativescript javascript app. I can build and run just fine on iOS emulators and devices with both debug and release builds, 'tho I notice some crashlytics log messages. I'm ready to upload to the App Store, but when I build with Xcode I receive the following errors:

ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseCoreDiagnostics'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseDatabase'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseInAppMessaging'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseInAppMessagingDisplay'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseInstanceID'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/FirebaseMessaging'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/GoogleDataTransport'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/GoogleDataTransportCCTSupport'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/MDFInternationalization'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/MaterialComponents'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/Protobuf'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/leveldb-library'
ld: warning: directory not found for option '-F/Users/david/Library/Developer/Xcode/DerivedData/festivelo-axwalveswgznjdhkxlukavauewlb/Build/Products/Debug-iphoneos/nanopb'
ld: framework not found FirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've verified that my firebase console settings are correct, that the GoogleService-Info.plist file is correct, and that firebase.nativescript.json is correct:

{
    "external_push_client_only": false,
    "using_ios": true,
    "using_android": true,
    "firestore": false,
    "realtimedb": true,
    "authentication": true,
    "remote_config": false,
    "performance_monitoring": false,
    "messaging": true,
    "in_app_messaging": false,
    "crashlytics": false,
    "storage": false,
    "functions": false,
    "facebook_auth": false,
    "google_auth": false,
    "admob": false,
    "dynamic_links": false,
    "ml_kit": false
}

I've uninstalled and reinstalled the iOS platform, cleaned Xcode's derived data folder, and run pod repo update. It sure looks like Xcode is trying to bring in firebase components that I'm not using, but I've run out of places to check.

Question: how can I get a clean Xcode build with only the firebase components I'm actually using?

Edit:

I followed Paul's suggestion, but got the following:

$ pod install 
Analyzing dependencies
Downloading dependencies
Installing Firebase (6.10.0)
Installing FirebaseAnalyticsInterop (1.4.0)
Installing FirebaseAuth (6.3.0)
Installing FirebaseAuthInterop (1.0.0)
Installing FirebaseCore (6.3.1)
Installing FirebaseCoreDiagnostics (1.1.1)
Installing FirebaseCoreDiagnosticsInterop (1.0.0)
Installing FirebaseDatabase (6.1.1)
Installing FirebaseInstanceID (4.2.5)
Installing FirebaseMessaging (4.1.6)
Installing GTMSessionFetcher (1.2.2)
Installing GoogleDataTransport (3.0.1)
Installing GoogleDataTransportCCTSupport (1.2.1)
Installing GoogleMaps (3.5.0)
Installing GoogleUtilities (6.3.1)
Installing MDFInternationalization (2.0.0)
Installing MaterialComponents (84.6.0)
Installing Protobuf (3.10.0)
Installing leveldb-library (1.22)
Installing nanopb (0.3.901)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 20 total pods installed.

It seems the issue comes from the file .ns-plugins-build-data.json in the /platforms/ios/Pods/ folder, which includes these lines:

"nativescript-plugin-firebase": {
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/Info.plist": "52368d781d8c6dc3498bfadd4b59790b4cbe2aaa",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile": "7c68e0a5a4f17a95b5ca9863e503f66d4e5a9086",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSCrashlyticsLogger.framework/Headers/TNSCrashlyticsLogger.h": "5018cdbf78957b475d01e617e240debaf8310b53",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSCrashlyticsLogger.framework/Headers/TNSCrashlyticsLoggerWrapper.h": "274baa9f00a34ab70bf651d10cd37b857bcb6d58",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSCrashlyticsLogger.framework/Info.plist": "80f7ea9052045100d02c82667abcef6722b1fa72",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSCrashlyticsLogger.framework/Modules/module.modulemap": "edf7a712a23e415884ac6444185bfb62aa3a89c8",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/Headers/TNSMLKitCamera.h": "78ea6480dd4f5bbce5b2d49221c43a3f10737f81",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/Headers/TNSMLKitCameraView.h": "6463ba0cae804c84eb87373abda07cdb214d2e2d",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/Headers/TNSMLKitCameraViewDelegate.h": "b3296ea9a63cc873bdf7def8836795049e598ec5",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/Info.plist": "c8e012468aceb390d0d746386b639be7aae2461a",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/Modules/module.modulemap": "22d675cfcdcd0abd299e79c602de3eb9553de68c",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/beep.caf": "9f5c25a7e9f3d08c887fe8a35b9b4ff75508fb1d",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/build.xcconfig": "aa1b078da3b7e00f79fe499c04ca4f3e8b50fdc2",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/TNSMLKitCamera": "34dd2c88baa6ce46695cfb29c4beb5b2a9fbe5f5",
    "/Users/david/Documents/NativeScriptProjects/festivelo/node_modules/nativescript-plugin-firebase/platforms/ios/TNSCrashlyticsLogger.framework/TNSCrashlyticsLogger": "d7275db8ad30a82844642689c0337cb86d2dbd44"
},

I'm not sure how to control the contents of this file. Presumably it should match the firebase components I'm actually using.


Solution

  • There are two separate issues here. I resolved the build problem by opening the .xcworkspace rather then the .xcodeproj file, as I had done before.

    The second issue is that I'm getting the entire firebase plugin included in the build rather then just the components I use. I'm taking this up as a firebase plugin GitHub issue.