ld: library not found for -lGoogleToolboxForMac
Asked Answered
D

5

12

I am implementing firebase setup via pods.

My Pods file looks like following one.

# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
# $(PROJECT_DIR)/build/Debug-iphoneos/GoogleToolboxForMac lib search path
target 'ProductName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for mCura

pod 'Firebase/Core'
pod 'Firebase/Messaging'

end

Everything is fine with iPad simulator. its running but when I run my application in iDevice. It shows library not found.

ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have already wasted 2 days for removing this error & tried everything I could find on net. And GoogleToolboxForMac library automatically installs when firebase pod get installed.

Doti answered 28/11, 2016 at 16:5 Comment(0)
D
17

I change my pod file to following code and re-install pod. It installed all necessary files for GoogleToolboxForMac.

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'ProductName' do

  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac', '~> 2.1'

end

After Installing pod

1) Change Scheme to Generic iOS Device and Build.

2) After build success you can see libGoogleToolboxForMac.a file in black colour instead of red.

3) Now select Device and run build on iDevice. Follow screenshot.

enter image description here

Or you can have build library libGoogleToolboxForMac.a

Doti answered 2/12, 2016 at 10:58 Comment(0)
T
16

I was also getting this exception:

enter image description here

It fixed after opening the /platform/ios folder in Xcode instead of /platform/ios/MyApp.xcodeproj file.

Thibodeaux answered 21/12, 2017 at 7:23 Comment(0)
A
11

I got the same error and it was fixed just by opening the project from the .xcworkspace file instead of the .xcodeproj.

Appel answered 3/1, 2019 at 1:49 Comment(0)
Y
1

Sigh.

For my Cordova project I just removed plugins, platforms and node_modules, readded IOS, and double clicked instead of using alt-down to open the xsworkspace and suddenly it magically worked.

Posting this here so I remember that it might be unnecessary to look for a real solution.

Yonit answered 17/5, 2018 at 13:1 Comment(0)
Q
1

This StackOverflow question: Framework not found GoogleToolboxForMac had the answer that fixed this for me, but it was not the most highly upvoted answer. I had to go to the build settings for the GoogleToolboxForMac target and change the "Build Active Architecture Only" setting from Yes to No. Then clean and rebuild.

Quasar answered 21/6, 2018 at 20:5 Comment(1)
sometimes, most up voted answer doesn't work for you as your issue is different from question given there. So Its better to have more than one option to choose from. One of 2-4 answers definitely works.Doti

© 2022 - 2024 — McMap. All rights reserved.