Admob causing linker command failed with exit code 1 Error - ios

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)

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

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

Related

Error while trying to Archive an Xcode project

Good evening guys!!
i have an xcode project that i want to publish on App Store. it`s building and running normally on a external device, but when i try to archive it, the following error occurs:
Ld /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/InstallationBuildProductsLocation/Applications/MinhaBibliaOffline.app/MinhaBibliaOffline normal armv7
cd /Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/BuildProductsPath/Release-iphoneos -L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Debug-iphoneos -L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Release-iphoneos -F/Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/BuildProductsPath/Release-iphoneos -filelist /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/IntermediateBuildFilesPath/MinhaBibliaOffline.build/Release-iphoneos/MinhaBibliaOffline.build/Objects-normal/armv7/MinhaBibliaOffline.LinkFileList -dead_strip -ObjC -lPods-AFNetworking -lPods-MMDrawerController -lPods-WYPopoverController -framework CoreGraphics -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lsqlite3 -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MinhaBibliaOffline -Xlinker -dependency_info -Xlinker /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/IntermediateBuildFilesPath/MinhaBibliaOffline.build/Release-iphoneos/MinhaBibliaOffline.build/Objects-normal/armv7/MinhaBibliaOffline_dependency_info.dat -o /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/InstallationBuildProductsLocation/Applications/MinhaBibliaOffline.app/MinhaBibliaOffline
ld: warning: directory not found for option '-L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Debug-iphoneos'
ld: warning: directory not found for option '-L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Release-iphoneos'
ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my Podfile implementation
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "7.0"
target "MinhaBibliaOffline" do
pod "AFNetworking"
pod "MMDrawerController", "~> 0.5.7"
pod "TAOOverlayHelp"
pod "WYPopoverController", "~> 0.2.2"
end
i have looked for a solution for hours, but still didn`t find one that worked
i've just found an answer that worked for me.. i'll write below because it might be useful to somebody.
In my case, i had to update the "Other Linker Flags" in my project target > Build Settings.
There were wrong references to the projects added via CocoaPods:
For example:
before: -l"Pods-AFNetworking"
i changed to: -l"Pods-MinhaBibliaOffline-AFNetworking"
I hope this answer helps
Cheers

xcode library not found for -lobjc

I am getting this error when I am trying to run it on my device, however it working fine when I run it on simulator. Is this a tool chain error or SDK header error? Below is the error message I obtain when compiling.
Error Message:
Ld /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec normal armv7
cd /Users/KhangYu/Desktop/KPTesting/setting
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Products/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system -F/Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework SystemConfiguration -framework AVFoundation -lsqlite3.0 -framework MapKit -framework CoreLocation -framework MessageUI -framework QuartzCore -framework Security -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/KhangYu/Library/Developer/Xcode/DerivedData/mobiletimetec-bbuzqjqgmijmomgdmvebkbyasqii/Build/Intermediates/mobiletimetec.build/Debug-iphoneos/mobiletimetec.build/Objects-normal/armv7/mobiletimetec
ld: library not found for -lobjc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
//-- END --
This is going to be the death of me. Any idea on how to solve it? Your help will be greatly appreciated.
Thanks in advance.
Solution
Thanks Kevin and Jasper Blues reply and also thanks Reno Jones to edit my post.
After hours of trying to fix this, I renamed the file "libobjc.A.dylib" to "libobjc.dylib"and the error disappear.
P/S: "libobjc.A.dylib" - located in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer‌​/SDKs/*/usr/lib/, thanks again to Kevin.
My guess is that it works on the Simulator, but not the device because you've specified separate 'OTHER LINKER FLAGS' for both 'Debug' and 'Release' configurations. You'd usually do this if you're linking in a debug framework such as 'Reveal', 'DCIntrospect', etc.
The one for 'Release' looks to be incorrect. It should be '-Objc' and not '-lObjc' - we're telling the compiler that we're using Objective-C itself, and not to load a library called 'Objc'.
To correct:
In Xcode, click on the target for your App.
Open the 'Build Settings' tab.
Search for 'Other linker flags' - so you're not overwhelmed by options.
Correct the 'Release' config. Change '-lObjc' to '-Objc'
There is no need to rename "libobjc.A.dylib", just re-link it like : ln -s ./libobjc.A.dylib ./libobjc.dylib

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

I'm trying to integrate Google Analytics in my iOS App. However unable to build after adding the Google Analytics sdk (v 3.01) which is the latest version in Xcode 5.
I have included all the dependent libraries/frameworks but still no go.
Below is the Activity Log:
Ld /Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Products/Debug-iphoneos/RamLeela.app/RamLeela normal armv7
cd /Users/yashsoni/Documents/NetProjects/Draft-MovieApp
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Products/Debug-iphoneos -F/Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Products/Debug-iphoneos -F/Users/yashsoni/Documents/NetProjects/Draft-MovieApp -filelist /Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Intermediates/Draft-MovieApp.build/Debug-iphoneos/Ramleela.build/Objects-normal/armv7/RamLeela.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=6.0 -lGoogleAnalyticsServices -framework CoreData -framework SystemConfiguration -lsqlite3 -framework CFNetwork -framework AdSupport -lz -lsqlite3.0 -framework Twitter -framework CoreLocation -framework Security -framework Accounts -framework Social -framework MessageUI -framework FacebookSDK -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Intermediates/Draft-MovieApp.build/Debug-iphoneos/Ramleela.build/Objects-normal/armv7/RamLeela_dependency_info.dat -o /Users/yashsoni/Library/Developer/Xcode/DerivedData/Draft-MovieApp-dnrjzfyordxcuggjpxwhqsoydvvy/Build/Products/Debug-iphoneos/RamLeela.app/RamLeela
ld: library not found for -lGoogleAnalyticsServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I suggest you to use xcode 5.02 or Xcode 5.1 (stable version) and then add google analytic accordingly then hopefully these errors will be resolved.
Same problems I am facing too before installing xcode 5.02.Hopefully it will help you too.
Have you added your library in "LIBRARY_SEARCH_PATHS"?
Sorry to have ans so late,It was a architecture problem. Ther error was only for iPhone 5s 64 bit Architecture. After updating the Google analytics framework got it working..!!
Let me know if that helps.
Make sure that you update the project settings as recommended by XCode , If its showing, This should solve this kind of issues most of times.

Linker Error When Integrating iOS and the Google Plus SDK

I'm trying to use the Google Plus SDK for sharing in an iOS 6.1 app and get a linker error after adding the GooglePlus.framework and the GoogleOpenSource.framework.
Merely including the frameworks and building yields the following errors:
Undefined symbols for architecture armv7:
"_CGRectDivide", referenced from:
-[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in GTMOAuth2ViewControllerTouch.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've followed instructions found in the Google guide to no avail.
I've done the following:
Included SystemConfiguration.framework and Security.framework
Dragged and dropped the GooglePlus.framework and the GoogleOpenSource.framework
from the SDK into my XCode project
Added the -ObjC flag to the app target's build settings
In addition to the previous steps I also tried adding the contents of the OpenSource folder provided in the SDK but that had no effect caused additional problems after the initial fix.
Libraries:
Full error message:
Ld "/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
Debug-iphoneos/MyAoo.build/Objects-normal/armv7/MyApp" normal armv7
cd /Users/me/code/MyApp
setenv IPHONEOS_DEPLOYMENT_TARGET 6.1
setenv PATH
"/Applications/Xcode.app/Contents/Developer/Platforms/
iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/
Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot
/Applications/Xcode.app/Contents/Developer/
Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
-L/Users/me/Library/Developer/Xcode/DerivedData/
MyApp-asdf/Build/Products/Debug-iphoneos
-L/Users/me/code/MyApp/MyApp
-F/Users/me/Library/Developer/Xcode/DerivedData/MyApp-asdf/Build/Products/Debug-iphoneos
-F/Users/me/code/MyApp/../../Documents/FacebookSDK -F/Users/me/code/MyApp
-F/Users/me/code/MyApp/MyApp
-filelist "/Users/me/Library/Developer/Xcode/
DerivedData/MyApp-asdf/Build/Intermediates/
MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp.LinkFileList"
-dead_strip -ObjC -lsqlite3.0 -fobjc-arc
-fobjc-link-runtime -miphoneos-version-min=6.1
-framework SystemConfiguration -framework Security
-framework CFNetwork -framework Social -framework Accounts
-framework EventKit -framework EventKitUI
-framework AVFoundation -framework MapKit
-framework Twitter -framework CoreMotion -framework CoreLocation
-lxml2 -framework QuartzCore
-framework MobileCoreServices -framework CoreData
-framework UIKit -framework Foundation
-framework Pinterest -framework GooglePlus
-framework GoogleOpenSource
-lGooglePlusUniversal -o
"/Users/me/Library/Developer/
Xcode/DerivedData/MyApp-asdf/Build/Intermediates/MyApp.build/
Debug-iphoneos/MyApp.build/Objects-normal/armv7/MyApp"
Undefined symbols for architecture armv7:
"_CGRectDivide", referenced from:
-[GTMOAuth2ViewControllerTouch moveWebViewFromUnderNavigationBar] in
GTMOAuth2ViewControllerTouch.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm not sure what I missed but any help would be greatly appreciated.
Also link in the CoreGraphics framework. It's looking for the CGRectDivide method, which is part of CoreGraphics.
This error is caused by adding OpenSource folder to you project, xcode detects that there is a duplication of files. So you should only add GooglePlus.framework and the GoogleOpenSource.framework.

Building an archive for Xcode 4.6 release with phonegap v 2.9 fails

This appears to be a recurring phenomena.
I saw a number of prior questions, where the solution was to delete armv6,
and then the archive would work. Of course, armv6 is gone.
So, now, building with both current, Xcode 4.6.3 phonegap 2.9.
And yes, the app works fine on iphones, ipads, and in the simulator.
I get this message at the end of the create archive step:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos -F/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos -filelist /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/peeq.build/Release-iphoneos/peeq.build/Objects-normal/armv7s/peeq.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a -ObjC -fobjc-link-runtime -miphoneos-version-min=5.0 -framework CoreLocation -framework ImageIO -framework OpenAL -framework AssetsLibrary /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos/libCordova.a -framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AddressBook -framework AddressBookUI -framework AudioToolbox -weak_framework AVFoundation -framework CFNetwork -framework MediaPlayer -framework QuartzCore -framework SystemConfiguration -framework MobileCoreServices -weak_framework CoreMedia -framework CoreLocation -o /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/peeq.build/Release-iphoneos/peeq.build/Objects-normal/armv7s/peeq
ld: file not found: /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And went over and looked around the file system there:
cd /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build
./Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/CordovaLib.build/Release-iphoneos/CordovaLib.build/Objects-normal/armv7s/libCordova.a
./Intermediates/ArchiveIntermediates/peeq/IntermediateBuildFilesPath/UninstalledProducts/libCordova.a
And it's been built, just not put where the linker wanted to find it.
So, no doubt some build setting either tells the linker to look there, or
tells the build to put it where the linker wants to find it.
Unless it's something else.
My question is how to get the app archive to build
correctly, so it can go off to the store.
A fine person who works at Apple told me where to look, at which point, this was solved.
Deep within the Build Settings, there is a field to be set, called Other Linker Flags
It starts out showing no value, but if you click on it, it pops up with Debug and Release.
In the very long string that is Release, one finds a -force_load libCordova.a
and deletes that part of the string.
From:
-weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load ${TARGET_BUILD_DIR}/libCordova.a -ObjC
To:
-weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -ObjC
Its probably a bug in some fashion that phonegap defaults this in place, I shall
also contact them and see if it can default repair it.
His note that pointed me at it:
I notice that your link command contains both this:
-force_load /Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/InstallationBuildProductsLocation/Applications/libCordova.a
and this:
/Users/peeq/Library/Developer/Xcode/DerivedData/peeq-gylybvwifdxjmtajtbvdsdpjcvkl/Build/Intermediates/ArchiveIntermediates/peeq/BuildProductsPath/Release-iphoneos/libCordova.a
The path being passed to -force_load is the bogus path that the linker is complaining about. I think that you need to remove the “-force_load” linker flag. Do you have such a flag set in the “Other Linker Flags” setting?
Found a fix.
In your Target's Build Settings, find Other Linker Flags
Change $(TARGET_BUILD_DIR)/libCordova.a
To $(BUILT_PRODUCTS_DIR)/libCordova.a
It's does not works for me to change to "$(BUILT_PRODUCTS_DIR)/libCordova.a" in "Other Linker Flags". The problem still exist. (Xcode 4.6.3 phonegap 2.9.0)
So, I try the setting below and it works for me.
In your Target's Build Settings, find "Other Linker Flags"
Delete "$(TARGET_BUILD_DIR)/libCordova.a"
Change "-force_load" to "-all_load"
This did the trick for me.
======== Update ============
With the above trick, I can achieve the app and submit to App Store with no issue.
But I found out in the iTune Connect that it shows "Invalid binary".

Resources