1

My iOS app is able to run normally on simulators, but when I tried to archive it, I got the following error.

ld: library not found for -lPods-MOEDict-Google-Mobile-Ads-SDK
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my other linker flags:

    -ObjC -l"Pods-MOEDict-Google-Mobile-Ads-SDK" -framework "AVFoundation" 
    -framework "AudioToolbox" -framework "CoreGraphics" -framework "CoreTelephony" -framework "EventKit" -framework "EventKitUI" 
-framework "GoogleMobileAds" -framework "MessageUI" -framework "StoreKit" -framework "SystemConfiguration" -weak_framework "AdSupport" $(inherited)
user2872856
  • 2,003
  • 2
  • 21
  • 54
  • 1. are you opening project or xcworkspace? Make sure xcworkspace is opened. 2. To ads sdk target is selected to correct project. 3. While adding library mention in google tutorial another reason of linking failure is copy library into project is not selected. – Amod Gokhale Sep 25 '16 at 10:27
  • Yes, I'm opening xcworkspace. My app and ads are running normally on simulators. But when I tried to archive it for publication of app, I got this error. – user2872856 Sep 25 '16 at 10:50
  • check this link http://stackoverflow.com/questions/22800793/ld-library-not-found-for-lgoogleadmobads/22801813#22801813 – Amod Gokhale Sep 25 '16 at 11:02

2 Answers2

3

Solved the problem myself my deleting the entire other linker flags and replaced it with $(inherited)

user2872856
  • 2,003
  • 2
  • 21
  • 54
1

If you are using cocoapods don't manage the pods manually.

Try running follow commands:

// Removes every trace of cocoapods from the xcode project
pod deintegrate
// Reinstalls and links cocoapods (probably gonna fix the missing framework)
pod install
Jens
  • 1,132
  • 7
  • 14