Nativescript-plugin-firebase: Unable to build iOS with clean install of Master-Client Firebase template (ld: warning: directory not found for option)

Created on 7 Dec 2018  ยท  15Comments  ยท  Source: EddyVerbruggen/nativescript-plugin-firebase

Getting following error upon running iOS simulator:

Executing after-prepare hook from /Users/leecocking/Dev/tns-ng-firebase-test/hooks/after-prepare/nativescript-plugin-firebase.js
Building project...
Xcode build...
=== BUILD TARGET tnsngfirebasetest OF PROJECT tnsngfirebasetest WITH CONFIGURATION Debug ===
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseAuth'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseDatabase'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseStorage'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/QBImagePickerController'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/leveldb-library'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/nanopb'
ld: warning: Auto-Linking framework not found CoreServices
=== BUILD TARGET tnsngfirebasetest OF PROJECT tnsngfirebasetest WITH CONFIGURATION Debug ===
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseAuth'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseDatabase'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/FirebaseStorage'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/QBImagePickerController'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/leveldb-library'
ld: warning: directory not found for option '-F/Users/lc/Library/Developer/Xcode/DerivedData/tnsngfirebasetest-darwhbrwnocxeldyszqeyoxotdvt/Build/Products/Debug-iphonesimulator/nanopb'
ld: warning: linking ObjC for iOS Simulator, but dylib (/Users/lc/Dev/tns-ng-firebase-test/platforms/ios/internal/NativeScript.framework/NativeScript) was compiled for MacOSX
ld: warning: linking ObjC for iOS Simulator, but dylib (/Users/lc/Dev/tns-ng-firebase-test/node_modules/nativescript-plugin-firebase/platforms/ios/TNSMLKitCamera.framework/TNSMLKitCamera) was compiled for MacOSX
ld: warning: linking ObjC for iOS Simulator, but dylib (/Users/lc/Dev/tns-ng-firebase-test/node_modules/nativescript-ui-listview/platforms/ios/TNSListView.framework/TNSListView) was compiled for MacOSX
ld: warning: linking ObjC for iOS Simulator, but dylib (/Users/lc/Dev/tns-ng-firebase-test/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework/TNSCore) was compiled for MacOSX
ld: warning: ObjC dylib (/Users/lc/Dev/tns-ng-firebase-test/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework/TNSWidgets) was compiled for iOS Simulator, but dylibs others were compiled for MacOSX
ld: warning: Auto-Linking framework not found CoreServices

tns doctor says my environment is good:

โœ” Getting environment information 

No issues were detected.
โœ” Your ANDROID_HOME environment variable is set and points to correct directory.
โœ” Your adb from the Android SDK is correctly installed.
โœ” The Android SDK is installed.
โœ” A compatible Android SDK for compilation is found.
โœ” Javac is installed and is configured properly.
โœ” The Java Development Kit (JDK) is installed and is configured properly.
โœ” Xcode is installed and is configured properly.
โœ” xcodeproj is installed and is configured properly.
โœ” CocoaPods are installed.
โœ” CocoaPods update is not required.
โœ” CocoaPods are configured properly.
โœ” Your current CocoaPods version is newer than 1.0.0.
โœ” Python installed and configured correctly.
โœ” The Python 'six' package is found.
โœ” Xcode version 9.4.1 satisfies minimum required version 9.
โœ” Getting NativeScript components versions information...
โœ” Component nativescript has 5.0.3 version and is up to date.
โœ” Component tns-core-modules has 5.0.5 version and is up to date.
โœ” Component tns-android has 5.0.0 version and is up to date.
โœ” Component tns-ios has 5.0.0 version and is up to date.

Environment
nativescript-angular: ~7.0.0
nativescript-firebase-plugin: ~7.4.0
tns: 5.0.3
angular: ~7.0.0
webpack: ~7.0.0
xcode: 9.4.1 (was originally 10.1)

Steps to reproduce

  1. Run tns create my-app-name --template tns-template-master-detail-ng
  2. Run tns platform add ios
  3. Run tns run ios --bundle

iOS always produces the same result, but Android always builds perfectly.

Troubleshooting

  • Delete everything and start again
  • Try tns platform remove ios then tns platform add ios
  • Downgrade xcode from 10 to 9.4
  • Ensure pod is up to date with pod repo update, pod update and pod install
  • Try tns run ios --bundle --clean
  • Try on a different computer (3 systems producing the same result actually)
  • Open project directly with Xcode and try building

No matter what I do it's the same result unfortunately.

Most helpful comment

FYI build error may be experienced because of an upstream issue in the Firebase iOS SDK as was reported in #1061. I've released 7.4.4 to fix that one.

All 15 comments

@EddyVerbruggen we are also experiencing the above on our builds. We noticed that the issue is happening only on machines where repo update was executed so I guess it might be related to some kind of incompatibility with the latest pod for the storage option (which is the only option enabled in the Kinvey master-details template)

@NickIliev Kinvey or Firebase? ๐Ÿ˜‰

sorry I meant Firebase (the template is the same but using Kinvey vs Firebase depending on the choice from SideKick)

Gotcha, thx

Hmm, these steps described by @lcocking run the app fine on my simulator (latest Xcode and NativeScript 5.0.3):

  • Run tns create my-app-name --template tns-template-master-detail-ng
  • Run tns platform add ios
  • Run tns run ios --bundle

Although I also get those "directory not found" messages (and always have!).

@NickIliev is the cloud build running the same script, with the latest Xcode and NativeScript?

Here's the last bit of my log:

ld: warning: directory not found for option '-F/Users/eddyverbruggen/Library/Developer/Xcode/DerivedData/myappname-cshlqdzfteicxbgkemtoskwyacml/Build/Products/Debug-iphonesimulator/leveldb-library'
ld: warning: directory not found for option '-F/Users/eddyverbruggen/Library/Developer/Xcode/DerivedData/myappname-cshlqdzfteicxbgkemtoskwyacml/Build/Products/Debug-iphonesimulator/nanopb'
error: the following command failed with exit code 0 but produced no further output
Ld /Users/eddyverbruggen/Library/Developer/Xcode/DerivedData/myappname-cshlqdzfteicxbgkemtoskwyacml/Build/Intermediates.noindex/myappname.build/Debug-iphonesimulator/myappname.build/Objects-normal/i386/myappname normal i386
note: Using new build systemnote: Planning buildnote: Constructing build description
Project successfully built.
Installing on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D...
Successfully installed on device with identifier '1E5C485A-4D01-471F-B7DA-50A3DBDE350D'.
Successfully transferred 0.js on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred bundle.js on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred fonts on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred FontAwesome.ttf on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred package.json on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred starter.js on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Successfully transferred vendor.js on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
Refreshing application on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D...
Successfully synced application org.nativescript.myappname on device 1E5C485A-4D01-471F-B7DA-50A3DBDE350D.
CONSOLE LOG file:///app/vendor.js:46159:20: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
CONSOLE LOG file:///app/vendor.js:46613:39: firebase.init done

Ok it seems that our app crash is happening runtime and the app is crashing without any error logs (the directory not found errors are not related). We are currently looking into this one and will flow up any related info.

P.S. The crash happens only after running

pod repo update

Then a project that have Firebase with storage is falling to start with a system error.

@EddyVerbruggen after running pod repo update I had to change this line in node_modules/nativescript-plugin-firebae/platforms/ios/Podfile

pod 'Firebase/Core', '~> 5.12.0'

to this one

pod 'Firebase/Core'

And the issue was resolved

@NickIliev If it was the other way around then it would have made sense, but I'll update the plugin to 5.14.0 nonetheless (it was released a few days ago https://firebase.google.com/support/release-notes/ios).

@EddyVerbruggen I think it might have to do with the optimistic operator usage ( ~>)

Well, ~> (the optimistic operator) is used when you want to specify a version 'up to next major | minor | patch'. For example:

~> 0.1.2 will get you a version up to 0.2 (but not including 0.2 and higher)

~> 0.1 will get you a version up to 1.0 (but not including 1.0 and higher)

~> 0 will get you a version of 0 and higher (same as if it was omitted)

If the above statement is true that would mean that '~> 5.12.0' will get updated up to 5.12.9 but won't get 5.14.0

@NickIliev Exactly, but according to their release notes there's no version between 5.12.0 and 5.13.0, and 5.12.0 seems to work just fine for me (even after a pod repo update). And the resolved version in platforms/ios/Podfile.lock is indeed 5.12.0.

Btw, I just tried building with 5.13.0 and 5.14.0 and there's a build error when Firestore is added to the firebase plugin config file, so I'll stick to 5.12.0 until I've found a fix for that.

FYI build error may be experienced because of an upstream issue in the Firebase iOS SDK as was reported in #1061. I've released 7.4.4 to fix that one.

Just getting back to this. Tried changing the podfile as per your suggestion @NickIliev, which seemed to resolve any pathing issues, but still getting a crash of the app in the simulator with no apparent errors or logs. Did that completely resolve the issue for you?

After playing around it looks like it was a configuration error with Firebase Storage. To diagnose the silent crash I ended up opening the iOS workspace in xcode and building there, which indicated an invalid argument for the initial storage call (my bucket gs path was incorrect).

@EddyVerbruggen I'm not sure if there's anything you can do to log something in the console when there's configuration errors like this, but if possible it would help shorten the diagnostic time for this and similar issues.

Thanks for reporting back. Where did you specify the incorrect bucket path?

i have still this issue how to fix this ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yencolon picture yencolon  ยท  4Comments

Aceman18 picture Aceman18  ยท  3Comments

thunder413 picture thunder413  ยท  3Comments

SBD580 picture SBD580  ยท  3Comments

NickIliev picture NickIliev  ยท  3Comments