Reputation: 1586
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?
Upvotes: 0
Views: 1912
Reputation: 110
This happened to me on two of my apps and caused me hours of frustration.
I will write down the process that I took:
/Users/jeremy/Library/Developer/Xcode/
and delete "DerivedData". Xcode will regenerate this on the next execution of your project.
I did try to do this by avoiding to redownload the SDK but had no success.
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.
Upvotes: 0
Reputation:
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.
Upvotes: 1