0

I am trying to implement admob in my app, so that it can display ads when iAd can't or won't. I am getting this error and I've tried everything that I could find online to fix it. Nothing seems to work.

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

To implement admob, I downloaded the latest GoogleMobileAdsSDK and unzipped it. I then went to Linked Frameworks and Libraries and added it there. I had to browse the location to which I unzipped it to get it. I also saw something online about adding -ObjC to Linking > Other Linker Flags, and I did that. When I build it, I get the error. If I remove it from Linked Frameworks and Libraries, my app will once again compile.

This is the full linker error:

Ld /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject normal x86_64 cd "/Users/Scott/Documents/Production Code/iOS7/Production/SampleProject" export IPHONEOS_DEPLOYMENT_TARGET=9.0 export PATH="/Applications/Xcode 7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 7/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode\ 7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode\ 7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Documents/Production\ Code/iOS7/Production/SampleProject -filelist /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -L/Applications/Xcode\ 7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.swiftmodule -framework GoogleMobileAds -framework iAd -Xlinker -dependency_info -Xlinker /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject_dependency_info.dat -o /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject

Any ideas on this?

2 Answers 2

1

I was able to solve the same problem with the following code.

Remove your GoogleMobileAds framework from your project. And add it again

Add this to the Library Search Paths in Build Settings and make sure you select recursive, delete other library paths which might be absolute paths.

$(PROJECT_DIR) 

May be it will help you.

0
0

This happened to me on two of my apps and caused me hours of frustration.

I will write down the process that I took:

  1. Delete all GoogleADMOB frameworks from Xcode project
  2. Move the files to the trash
  3. Navigate to

/Users/jeremy/Library/Developer/Xcode/

and delete "DerivedData". Xcode will regenerate this on the next execution of your project.

  1. Empty Trash
  2. Force quit Xcode and any simulators
  3. Restart Computer
  4. Download a new SDK from google

Download GoogleADMob SDK

I did try to do this by avoiding to redownload the SDK but had no success.

  1. Place them into your project as you had them before and run.

I have seen many different solutions, but they personally did not work for me. I really hope this helps anyone else who comes across this issue. It will save you the time and stress.

Not the answer you're looking for? Browse other questions tagged or ask your own question.