Firebase Analytics fails ios build only: ld: library not found for -lGoogleToolboxForMac

result when I try toionic build ios --release

The following build commands failed:
Ld /Users/neil/Library/Developer/Xcode/DerivedData/Cardihab_App-ccypvivwehrhfsgvurieehkuktar/Build/Intermediates.noindex/Cardihab\\\ App normal i386
Ld /Users/neil/Library/Developer/Xcode/DerivedData/Cardihab_App-ccypvivwehrhfsgvurieehkuktar/Build/Intermediates.noindex/Cardihab\\\ App normal x86_64
(2 failures)
node:10777) UnhandledPromiseRejectionWarning: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/neil/Projects/cardihabApp/platforms/ios/cordova/build-release.xcconfig,-workspace,Cardihab App.xcworkspace,-scheme,Cardihab App,-configuration,Release,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/neil/Projects/cardihabApp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/neil/Projects/cardihabApp/platforms/ios/build/sharedpch
(node:10777) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10777) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

When I open up XCode XCode Errors

ld: library not found for -lGoogleToolboxForMac

clang: error: linker command failed with exit code 1 (use -v to see invocation)


OK – so solved it on my own by…

install cocopods
sudo gem install pods
this takes ages – which you already know
change directories to platform/ios
cd platform/ios
run pod install
pod install
change directories back your ionic project
cd ../../
run ios build
ionic cordova build ios
the trick is to open the workspace file - not the project file
Build and Run it on real device from there – there shouldn’t be an error now when you build or archive


It works. Thank you!

1 Like