简体   繁体   中英

Xcode error: library not found for -lGoogleToolboxForMac

I am trying to install admobs in my iPhone App (written in objective-c). I have implemented this many times using swift projects, but currently I keep getting the following build error:

ld: warning: directory not found for option '-L/Users/charlieseligman/Library/Developer/Xcode/DerivedData/ThamesClippers-csissodainpbbjenykdyxuutzxtg/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/charlieseligman/Documents/GIT/iOS.ThamesClippers/build/Debug-iphoneos/GoogleToolboxForMac'
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am definitely opening the .xcworkspace file (and not the .xcodeproj file).

I have also tried deleting 'DerivedData' folder contents & 'Cleaning' the project and doing a 'Clean Build Folder'. None has resolved the issue.

My podfile only includes the following pods:

# Pods for ThamesClippers
pod 'Google/Analytics'
pod 'Firebase/Core'
pod 'Firebase/AdMob'

# Trying to fix GoogleToolboxForMac missing error
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac/Logger' 
pod 'GoogleToolboxForMac', '~> 2.1'

I have tried adding the bottom 3 one-by-one but kept getting the same build error.

Can anyone help? At a complete loss on this one. Seen these two questions but their accepted solutions have not resolved this issue:

Framework not found GoogleToolboxForMac ld: library not found for -lGoogleToolboxForMac

Finally worked out a fix:

  1. Xcode > Product > Scheme > Manage Schemes
  2. Select to 'Show' the scheme that was failing (GoogleToolboxForMac)
  3. Select this scheme in the dropdown, just to the right of the 'Stop' button
  4. Build this scheme
  5. Then select the original scheme (in the dropdown mentioned in step 3) and rebuild

All built correctly.

So it looked like I had to build the separate scheme manually.

Note: To build these automatically, use Product > Scheme > 'Edit Scheme' > Build > And make sure all targets are added with your project target at the bottom.

I got this error in Xcode 10 when building to the Simulator . This is because I deleted the Debug base configuration in the xcodeproj when attempting to resolve the Cocoapods warning: "CocoaPods did not set the base configuration of your project because your project already has a custom config set."

I resolved the issue by:

  1. Adding the Debug base configuration
  2. Setting the Debug configuration value to None
  3. Running pod install

This is how the base configuration should look like after step 3: Xcodeproj配置 ] 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM