Auto-Linking framework not found - ios

I have forked a framework called BTNavigationDropdownMenu (swift project for ios). all worked fine till I tried to add a dependency to the latest version in the branch I created. the problem is the same whether I add the other framework (DYBadge) through a podfile or through Carthage.
Auto-Linking framework not found DYBadge.
It seems to have a problem with a UIView extension that is part of DYBadge.
DYBadge works fine in my main app I'm working on (I also need it in the app target).
errors below. thanks for any hints into the right direction.
ld: warning: Auto-Linking framework not found DYBadge Undefined
symbols for architecture x86_64: "(extension in
DYBadge):__ObjC.UIView.getBadge() -> DYBadge.DYBadge?", referenced
from:
Demo.BTNavigationDropdownMenu.updateBadge(text: Swift.String, at: Swift.Int) -> () in BTNavigationDropdownMenu.o ld: symbol(s) not
found for architecture x86_64 clang: error: linker command failed with
exit code 1 (use -v to see invocation)

Xcode is not able to find your frameworks because the FRAMEWORK_SEARCH_PATHS is probably not set or is wrong (happened to me because I moved the Info.plist file).
You can fix this by going into your target and adapt the Build Settings. Simply search in there for FRAMEWORK_SEARCH_PATHS and add the correct one, which is usually $(PROJECT_DIR)/Carthage/Build/iOS (for iOS projects). $(inherited) should also be in there as the first entry.
This is the post of #user3122959 answer in the comments, which helped me and others to fix this problem and was requested to put in as the answer to this question.

Try this process -
Press "Cmd + Shift + K" or shift + cmd + alt + k to clean up, and quit Xcode.
Delete the cache Run "rm -rf ~/Library/Developer/Xcode/DerivedData" in terminal
Open the project and re-build it

I had this problem accessing 3rd party frameworks from my tests. Here's how I fixed it.
In Xcode goto: Your Unit-Test target > Build Phases > Link Binary With Libraries
In Finder goto: Carthage > Build > yourframework.Framework
Drag the framework in to your build phases then clean (cmd - shift - K).

This can also be an error if you use a framework that has Bitcode Enabled on false.
Bitcode Enabled can only be true if all frameworks also have Bitcode enabled true.
Go to your targets build settings and disable bitcode.

For me this fixed it:
Go to Project > Targets > Build Settings (Tab) > Build Options (Heading)
Set Enable Testing Search Paths to Yes.
Instantly back up and running. Honestly not sure what this means but it worked.

If you are using Carthage and several Projects within one Workspace you have to add a symlink to your Main Carthage Folder. it will depend what structure you have, but for example if you have
Project -> Carthage
Project -> Frameworks -> MyImbaFramework than cd in terminal in MyImbaFramework folder and run
ln -s ../../Carthage Carthage

In my case, there was an issue with Bitcode, but Xcode couldn't give an accurate error diagnostic since the project framework references were also somehow messed up. Running the framework tests worked fine, but archiving gave the auto-linking error.
Deleted all framework references from the project, including the Frameworks group they were under, added them back again resolved the references issue, then I got the bitcode issue, which I disabled on the target framework, then and only then, archiving was successful

I had a similar error and none of the suggestions on this page worked. It occurred when trying to create an archive when pointing to my test iPhone, when I changed it to 'Any iOS Device' it worked correctly. I suspect this is related to the recent change to add support for Apple Silicon but I'm not certain how.

Make sure you haven't set a testfile that imports XCTest's TargetMembership to the main target, but to a test target :-)

Hope this helps someone, this is what worked for me
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf Pods
rm Podfile.lock
pod cache clean --all
pod install --repo-update
and cleaning the build folder
XCode > Product > Clean Build Folder
or
⌘ Command + ⇧ Shift + K
then closing XCode an clearing the derived data again
rm -rf ~/Library/Developer/Xcode/DerivedData

For me, the problem was that I had set the "Other Linker Flags" setting prior to converting my project to use Cocoapods. To fix this, I changed that field to use $(inhereted) and everything worked after that.

Related

Library not found for -lAFNetworking Xcode issues

ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/AFNetworking'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/JSONModel'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/ReactiveCocoa'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/Realm'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/dom-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/SAMKeychain'
ld: warning: directory not found for option '-L/Users/kh/Library/Developer/Xcode/DerivedData/om-euxqzibzllbcmndwqrgthdeotiro/Build/Products/Debug-iphonesimulator/Sentry'
ld: library not found for -lAFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Some Solutions I tried , and all of below didn't work which was previously suggested on similar stackoverflow questions
Opening xcworkspace, yes I am opening that.Not the project
Restart xcode
Clean & Build multiple times.
Deleted pods folder, and installed pods again.
pod update multiple times
set Build Active architecture Only to Yes
Selected my Target, went to "Build Phases" in "Link Binary With Libraries" removed ".a" file of that library. Clean and Build.
Target -> Build Settings ->Other Linker Flags = $(inherited)
Target -> Build Settings ->Library Search Path = $(inherited)
Note that libPods-om.a is giving me red whenever i add in target ( choose frameworks and libraries to add)
Worth to note, it runs onreal physical device. but not simulator
I had same issue on Xcode 12.4, only on simulators (on device works well).
Solved by adding arm64 for key Any iOS Simulator SDK on Build Settings < Excluded Archicetures. Add on
Project settings, and
Pods settings
Or, you can try another solution (also worked for me):
adding arm64 for key Any iOS Simulator SDK on Project settings
add config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" on Pod file
I had the same issue you are describing. I tried most of the things you mention but none of them worked. In the past I have been 100% successful in running this on the simulator (whenever I was working on a non-UI thing) and needless to say also successful in running it on a real device. Something happened in the last 2 weeks where now neither the simulator nor the real-device can be used.
In the end I just decided to bite the bullet, start from scratch and clone the remote git repository from where the project resides. Note that before doing this I moved my non-working folder into a safe location (Desktop) and cloned the repository into the same location as the non-working used to be.
After that I ran pod install in the folder of the freshly-cloned project and ran it on a physical device. It worked on the first go.
However I still cannot used the simulator. But I'm happy to have gained back the physical device at least.
UPDATE:
SOLUTION FOUND!!
After about a day of researching and trying multiple things. I found a solution here:
https://github.com/CocoaPods/CocoaPods/issues/10059#issuecomment-693346078
Short summary a new entry is added; it is located in Build Settings->User-Defined->VALID-ARCHS. I deleted this, and now I can run both on simulator and on-device.
Please try delete the Derived Data and pod install again /Library/Developer/Xcode/DerivedData
pod install
Go to Build Settings
Add new key under User-Defined section
VALID_ARCHS : armv7 armv7s arm64 arm64e x86_64

Undefined symbols for architecture arm64 when running it to device [duplicate]

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods.
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FBSession", referenced from: someFile
ld: symbol(s) not found for architecture arm64
I get about 12 of these, for the various Pods I use.
I am trying to build for the iPhone 5S using XCode 5.
I've been trying various solutions here on SO, but haven't got any of them to work yet.
How do I fix this Apple Mach-O Linker Error?
Just found another warning that might be interesting, I hope this leads me to the solution:
Ignoring file ~/Library/Developer/Xcode/DerivedData/SomeApp/Build/Products/Debug-iphoneos/libPods.a,
file was built for archive which is not the architecture being linked (arm64):~/Library/Developer/Xcode/DerivedData/someApp/Build/Products/Debug-iphoneos/libPods.a
If your Architectures and Valid Architectures are all right, you may check whether you have added $(inherited) , which will add linker flags generated in pods, to Other Linker Flags as below:
The issue is that the cocoapods have not been built for arm64 architecture yet thus they cannot be linked when you build them. Likely you cannot use those packages until they are updated and use that architecture. You can fix the linker error by going to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s.
Note though, this means you won't get the full power of the 64 bit processor. You said you are building for the 5s, so there may be some reason you need this. If you for some reason absolutely need that power (perhaps you are building a game), and desperately need those files, you could submit a pull request and then recompile the project to arm64 by setting those same fields to arm64 in the files you pulled from the open source projects. But, unless you really need these files to be 64 bit compatible, that seems like a bit of overkill for now.
EDIT: Some people also reported that setting Build For Active Architectures to YES was also necessary to solve this problem.
As of 2014-04-28 the setting should look something like this:
I solved this problem by setting that:
ARCHS = armv7 armv7s
VALID_ARCHS = armv6 armv7 armv7s arm64
I ran into the same/similar issue implementing AVPictureInPictureController and the issue was that I wasn't linking the AVKit framework in my project.
The error message was:
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_AVPictureInPictureController", referenced from:
objc-class-ref in yourTarget.a(yourObject.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The Solution:
Go to your Project
Select your Target
Then, go to Build Phases
Open Link Binary With Libraries
Finally, just add + the AVKit framework / any other framework.
Hopefully this helps someone else running into a similar issue I had.
I also encountered the same problem , the above methods will not work . I accidentally deleted the files in the following directory on it .
Folder emplacement:
~/Library/Developer/Xcode/DerivedData/
Set Architectures to armv7 armv7s, Build Active Architecture Only to NO, for every target in the project, including every one in Pods
I fixed mine by checking the selected implementation files in the target membership on the right side. This is useful especially in dealing with extensions i.e. custom keyboards.
Here are some explanations why build_active_architecture is set to NO.
Xcode now detects which devices you have connected and will set the active architecture accordingly. So if you plug a 2nd generation iPod Touch into your computer, Xcode should set the active architecture to armv6. Building your target with the above Debug configuration will now only build the armv6 binary to save time (unless you have a huge project you may not notice the difference but I guess the seconds add up over time).
When you create a Distribution configuration for publishing to the App Store, you should make sure this option is not set, so that Xcode will instead build the fat universal binary
http://useyourloaf.com/blog/2010/04/21/xcode-build-active-architecture-only.html
This might be related to libz.dylib or libz.tbd, just have to add it to your targets for the linking binaries, and try to compile again.
You need to just remove arm64 from Valid Architecture and set NO to Active Architecture Only . Now just Clean, Build and Run. You will not see this error again.
:) KP
Solved after deleting the content of the DerivedData-->Build-->Products-->Debug-iphoneos
I solved it by setting valid archs to armv7 armv7s and setting build active architectures only to YES in release and then doing a new "pod install" from the command line
Following worked for me:
Remove all pods
cd ios && pod deintegrate
Comment this line in ios/Podfile -> use_flipper!()
Reinstall all pods arch -x86_64 pod install
Run your app :) npm run ios
Environment:
Node version: 14.17.1
RN version: 6.0.0
OS: macOS BigSur m1
Given an iPhone 5s and not yet having received a 64 bit version of a third party library, I had to go back to 32 bit mode with the latest Xcode (prior to 5.1 it didn't complain).
I fixed this by deleting arm64 from the Valid Architectures list and then setting Build Active Architecture Only to NO. It seems to me this makes more sense than the other way around as shown above. I'm posting in case other people couldn't get any of the above solutions to work for them.
I had the same problem after upgrading to Xcode 5.1 and fixed it by setting Architectures to armv7 armv7s
Had been stuck on this issue the whole day.
I had multiple Schemes, it was compiling fine for Demo, Internal, Release - however Debug scheme just would not compile and was complaining about the libPods.a missing.
The solution was to go to the Project -> Target -> Build Settings and change "Build Active Architecture Only" to YES. Clean and build! Finally hours of head itching solved!
Setting -ObjC to Other Linker Flags in Build Settings of the target solved the problem.
This worked for me:
ios sdk 9.3
into your build setting of app.xcodeproj
valid architecture: armv7 armv7s
Build Active architecture : No
Clean and build , worked for me.
If you faced this issue on your Flutter project while building in Release mode (or Archive) check out my this answer: https://stackoverflow.com/a/61446892/5502121
Long story short:
set your build system to New Build System in File > Project Settings…
remove ios and build_ios folders
run flutter create . to init new ios module
run pod install
run flutter pub get
check your Xcode build config (it should be Release mode and General iOS Device)
and you're good to go
The following worked for me to get GPUImage compiling without errors on Xcode 5.1 for both the 64-bit simulator and retina iPad Mini, without needing to remove arm64 from the Valid Architectures list (which defeats the purpose of owning a 64-bit device for testing 64-bit performance).
Download the .zip folder from the GitHub page: https://github.com/BradLarson/GPUImage
Unzip, and navigate to the 'framework' folder. From here, add and copy the 'Source' folder into your Xcode project. Ensure 'Copy items into destination group's folder' is ticked, and that 'Create groups for any added folders' is also ticked. This will copy the generic, iOS and Mac header/implementation files into your project.
If you don't need the Mac files because you're compiling for iOS you can delete the Mac folder either before you copy the files into your project, or simply delete the group from within Xcode.
Once you've added the Source folder to your project just use the following to begin using GPUImage's classes/methods:
#import "Source/GPUImage.h"
A few things to point out:
If you get an error saying 'Cocoa' not found, you've added the Mac folder/headers into your iOS project - simply delete the Mac group/files from your project and the warning will vanish
If you rename the Source folder (not the group in Xcode), use that name instead of "Source/GPUImage.h" in the #import instruction. So if you rename the folder to GPUImageFiles before you add to your project, use: #import "GPUImageFiles/GPUImage.h
Obviously ensure arm64 is selected in the Valid Architectures list to take advantage of the A7 64-bit processor!
This isn't a GPUImage.framework bundle (such as if you downloaded the framework from http://www.raywenderlich.com/60968/ios-7-blur-effects-gpuimage) so it may not the correct way to use GPUImage that Brad Larson intended, but it works for my current SpriteKit project.
There's no need to link to frameworks/libraries etc - just import the header and implementation source folder as described above
Hope the above helps - it seems there were no clear instructions anywhere despite the question being asked multiple times, but fear not, GPUImage definitely works for arm64 architecture!
This issue occurred for me after installing a pod via Podfile and pod install. After trying a bunch of different fixes I finally just imported the Pod manually (dragging the necessary files into my project) and that solved the problem.
As morisunshine answer pointed in right direction, a little tweak in his answer solved my problem for iOS8.2 .Thanks to him.
I solved this problem by setting that:
ARCHS = armv7
VALID_ARCHS = armv6 armv7 armv7s arm64
BUILD ACTIVE ARCHITECTURE ONLY= NO
Go to target Build Settings.
set BUILD ACTIVE ARCHITECTURE ONLY = NO for both Debug and Release
Build and run
In my case, I had to look for
C++ Standard Library and make sure that the libc++ was the one selected.
For me, I use opencv 2.4.9 in xcode 7.2 for iOS and the errors above occurred, and I solve the errors by using the opencv through pod install rather than offline opencv framework.
You can have a try by adding the opencv pod text below and delete the offline opencv framework if you have used.
pod 'OpenCV', '2.4.9'
None of the solutions fix this error in my case(Xcode 9), with TesseractOCRiOS. After hours of trial and error, I came up with a good solution. I just delete 'pod 'TesseractOCRiOS', '~> 4.0.0' in the Podfile, run pod install. And then, add pod 'TesseractOCRiOS', '~> 4.0.0' back to Podfile and run pod install again.
Bang! It works!
"The OPN [Debug] target overrides the OTHER_LDFLAGS build setting". This was the main issue. After adding $(inherited) in new line in other linker flags solved my issue.
in some case, if you define one more interface in a .h file, but did not implementation all these interface, this error occurred.
The linker can't found the implementation in .m file, so you need to implementation it in your .m file for every interface.
To resolve this error:
1.in .m file, supply the implementation for each interface.
2.rebuild
I faced the same issue.
My solution I found here: Why linker link static libraries with errors? iOS
Adding $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to the library search paths fixed the problem.
This error consumed my whole day so thought of writing what really worked for me
delete .xworkspace
delete podfile.lock
delete the Pods folder/directory
"DO NOT DELETE PODFILE"
After all this, CLEAN(OPTION + SHIFT + CMD + K) --> BUILD(CMD + B) --> RUN(CMD + R)
I hope this really works for you :)

Apple Mach-O Linker & Ditto Error - Xcode 8

I have just updated my Xcode to Xcode 8 and am now trying to convert my project's code to Swift 2.3. I was able to build a couple times using Xcode 8 without any errors. Now, the following errors came up:
Error #1: Apple Mach-O Linker Error: Linker command failed with exit code 1
ld: file not found: /Users/Linus/Library/Developer/Xcode/DerivedData/MyApp-asdjeshhsetnfxbegcsbcipdreneewgr/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/DownloadsViewController.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't even know what a .o file is. The swift file of DownloadsViewController is there, though.
Error #2: Ditto Error: Command /usr/cin/ditto failed with exit code 1
ditto: can't get real path for source '/Users/Linus/Library/Developer/Xcode/DerivedData/MyApp-asdjeshhsetnfxbbciegrfdpdreneewgr/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp-Swift.h'
Command /usr/bin/ditto failed with exit code 1
The ditto error occurs 3 times: for MyApp.swiftdoc, MyApp.swiftmodule, and MyApp-Swift.h.
Thanks in advance!
Quit Xcode
Restart the System
Select Xcode -> Preferences.
This will open a pop-up window. Select 'Locations'. In Locations, you will see 'Derived Data'. Click on the arrow icon right next to the path.
This will open a folder containing 'Derived Data', delete it.
Clean the Product and Run
Make sure you open the project from the .xcworkspace file instead of the .xcodeproj
step 1 = clicking on the project in the navigation menu
step 2 = select the project
step 3 = build settings
step 4 = search enable bitcode if bitcode is yes than change to No
None of the previous answer have solve my problem.
I think it come from changes in the cocoapods podFile, from using frameworks to not using them
Frameworks was still remind in Target>General Properties>Linked Frameworks. I removed them
I also remove the -framework and corresponding frameworks from other linker flags (saving inherited and objC flags)
Hope that could help
This happened to me after I delete my app while it was running.
I solved it cleaning the project.
Product > Clean or Shift + Command + K
This is because at some point some project file was not compiled. In my case the AppDelegate.swift was not in the compiler. So I added it manually and it worked.
Clean XCode with following cmds and rebuild:
rm -rf ~/Library/Developer/Xcode/DerivedData/
killall Xcode 2> /dev/null
killall Instruments 2> /dev/null
killall 'iOS Simulator' 2> /dev/null
killall Simulator 2> /dev/null
killall 'Simulator (Watch)' 2> /dev/null
killall ibtoold 2> /dev/null
killall simctl 2> /dev/null
# There may be others
# Kill the service itself
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
rm -rf ~/Library/*/CoreSimulator
For my react native app, I deleted a folder of a test project inProject Navigator and Targets. It solved my problem.
Don't wory ,just go to your project targat and then build setting and search enable bitcode change it to YES to NO.
Turning Bitcode to "No" solved this issue. This is found in the Build Settings.
I had the same problem when I changed Xcode from a previous version 7 to the new XCode 8. In the new Xcode (8.3.3 now) there are more settings in the compiler.
When you update the project settings into new Xcode (using Editor->Validate Settings), these new settings are applied and set to the default value YES. After this update I had the linker error!
In my project I compared the previous version of the file .pbxproj with the new one (after Settings validation) using Beyond compare (or similar).
In this way I can saw the new settings added in the new version of Xcode and I set the new Settings value to NO. After this update all was OK and the linker error disappear.
If you're importing a framework through Build Phases, try to put it inside the folder of your project and add it into Link Binary with libraries. Actually, I've already experienced that problem before, I am very frustrated with that error until I knew that I have to put the .framework inside the folder of my project.
Hope will help
On top of cleaning derived data and the project and restarting xcode, I've found that re converting your project to current swift syntax and re installing pods if you have them also helps.
To re convert your project you will need to set swift_version build setting back to yes so that your target appears in the conversion list.
The issue I found with XCode 8.2.1 (Version 8C1002) after I converted the project to Current Swift Syntax (Swift 3). I just needed to rebuild it after cleaning, and the errors disappeared.
If the procedure of cleaning and the disabling of bitcode does not work, then it's possible that the reason for the errors simply is a more complex syntax error in your code.
I got the same problem because I had defined a class (using #interface), but did not provide an implementation (using #implementation) for it. It was a simple class so even an empty implementation resolved it.
Also just check if you are importing a "*.m" implementation file in any of your classes, that can cause the same issue.
Removing the import statement can fix the issue
For me it was a problem with react native haptic. I think it was because of a change in CocoaPods but also because of changing up file locations. I just removed it and re installed it. Hope this helps someone.
UPDATE
The build succeeded by when running it it would just crash. To solve this I used File > Add Files to Project for the GoogleService-Info.plist and it worked.
Please make sure you have following changes in Workspace setting in your xcode:
Please go to your workspace setting and make the following changes:
Workspace Setting:
Build System:
Legacy Build System
Per -User Workspace
DerivedData:
Workspace relative location
Build System
Use User Setting
Hope it helps:
Follow the below steps:
step1: Go to Build Phase Tab then only expand Link Binary with Library
step2: Then Go to General Tab then Expand Linked Framework & Library
(because Yourprojectname.framework is disable)

Error "library not found for" after putting application in AdMob

I am getting an error after I put my application in an AdMob. The app was working until today. The error is the following:
ld: library not found for -lGoogleAdMobAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this? Thank you.
I had a similar "library not found" issue. However it was because I accidentally was using the .xcodeproj file instead of the .xcworkspace file.
Sometimes you just remove the reference of the library and add reference again.
Apart from adding the Google Mobile Ads SDK and other libraries again from scratch, I would recommend you checking the Library Search Paths. There are instances when you copy or duplicate a target, Xcode decides that it needs to escape any double quotes " with a '\'. Make sure you remove all the \’s - it should look like this -
I was able to duplicate the error, by doing prefixing my path with multiple '\'.
Select your Target, go to "Build Phases" in "Link Binary With Libraries" remove ".a" file of that library.
Clean and Build.
If error related to Cocoapods as follow:
library not found for -lPod-...
You need to check Other Linker Flags and remove it from there.
Extra Information: If you have an old project that uses cocoapods. And recently you needed to add the use_frameworks! to your podfile.
cocoapods will not add the libraries to your Other Linker Flags
anymore cause its inherited. Therefore, you may need to remove those
manually from the other linker flags which they were added before
using the use_frameworks!
For my case Xcode 7, also worked in Xcode 9.1/9.2
ld: library not found for -ldAfnetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
set Build Active architecture Only to Yes
If error is like following
ld: library not found for -lpods
I found that a file "libPods.a" which is in red colour(like missing files) was created somehow in the Framework group of the project. I just simply removed that file and everything got fine.
EDIT: Another Solution
Another Solution that I have already answered in the similar question is in this link
goto Build Phases -> Link Binary With Libraries and remove library which show errors because that library is not available in project folder
Late for the answer but here are the list of things which I tried.So it will be in one place if anyone wants to try to fix the issue.
Valid architecture = armv7 armv7s
Build Active Architecture only = NO
Target -> Build Settings ->Other Linker Flags = $(inherited)
Target -> Build Settings ->Library Search Path = $(inherited)
Product Clean
Pod Update in terminal
ld: library not found for
It is compile time error for a Static Library that is caused by Static Linker
ld: library not found for -l<Library_name>
1.You can get the error Library not found for when you have not include a library path to the Library Search Paths(LIBRARY_SEARCH_PATHS)
ld means Static Linker which can not find a location of the library. As a developer you should help the linker and point the Library Search Paths
Build Settings -> Search Paths -> Library Search Paths
2.Also you can get this error if you first time open a new project (.xcodeproj) with Cocoapods support, run pod update. To fix it just close this project and open created a workspace instead (.xcworkspace )
[Vocabulary]
As for me this problem occurs because i installed Material Library for IOS.
to solve this issue
1: Go to Build Settings of your target app.
2: Search for Other linker flags
3: Open the other linker flags and check for the library which is mention in the error.
4: remove that flag.
5: Clean and build.
I hope this fix your issue.
In my case there was a naming issue. My library was called ios-admob-mm-adapter.a, but Xcode expected, that the name should start with prefix lib. I've just renamed my lib to libios-admob-mm-adapter.a and fixed the issue.
I use Cocoapods, and it links libraries with Other linker flags option in build settings of my target. The flag looks like -l"ios-admob-mm-adapter"
Hope it helps someone else
Simply, GoogleAdMobAds.a is missing in project target.
For me it was libAdIdAccessLibrary.a Please check attached screenshot
In the case of ld: library not found for -{LIBRARY_NAME} happened because the library file(s) is not existing.
Check the library path on your application targets’ “Build Phases”
Library Search Paths tab.
The library file(s) path must be according to the real path for example if your file(s) in the root of the project you must set the path like $(PROJECT_DIR)
I know this is a bit old, but I just hit a similar issue and running 'pod update' fixed this for me. My library error was with AFNetworking...
Just be careful doing pod update if you don't use explicit versions in your pod file.
This error is very weird.
I had this error with -ldAfnetworking and I only copy my project in other path and works.
I tried renaming my build configuration Release to Production, but apparently cocoa pods doesn't like it. I renamed it again to Release, and everything builds just fine.
#raurora's answer pointed me in the right direction. I was including libraries in my "watchkitapp Extension/lib" path. In this case, the Library Search Path needed to be escaped with a '\', but the linker didn't seem to understand this. To fix / work-around the issue, I moved my lib path up one level so it was no longer in a directory that contained a space in the name.
I just update the pod file 'pod update' and it start to work for me normally.
Running 'pod update' in my project fixed my problem with the 'library not found for -lSTPopup' error.
Remarking Trevor Panhorst's answer:
"Just be careful doing pod update if you don't use explicit versions in your pod file."
Easy solution. Here's how I'd fix the issue:
Go to the directory platforms/ios
Then, execute the command pod install
That's it. This should install the missing library.
Cleaned Build Folder
Restarted XCode
Went away...
I was getting similar bugs on library not found. Ultimately this is how I was able to resolve it
Before starting with Xcode Archive, used flutter build iOS
Changed the IOS Deployment Target to a higher target iOS 11.2 . Earlier I had something like 8.0 which was giving all the above errors.
Made sure that the IOS deployment targets in Xcode are same in the Project, Target and Pods
I was also facing the same issue and spent more than 24 hours to solve this, I tried everything from the above solutions but what finally works for me is
Build settings -> Select Target
Basics
User-defined
Change the VALID_ARCHS to arm64
Dude you need a reinstallation.
Delete simply "rm -rf" pods.
Install Pods "bundle exec pod install"
Works well then.
the same here, but in my case was resolved with answer the kenorb

RestKit Derived Data Troubles

I'm trying to get going with Restkit. I've followed the install instructions here: https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x
I'm running Xcode 4.3.2. When I try to run the RKCatalog project, I get an error: clang: error: no such file or directory: '/Users/sparky/Library/Developer/Xcode/DerivedData/RKCatalog-fdohdnazcupmydfaxxedezitkbpl/Build/Products/Debug-iphonesimulator/RestKit/RestKit'
I'm not an Xcode expert. I'm not sure where to go from here.
If you have Restkit.framework added in the libraries in "Build Phases" (Targets > Build Phases > Link Binary With Libraries) you have to remove it. I learnt from one of the discussions on GitHub that Restkit.framework is for Mac OSX and libRestKit.a is for iOS.
I had a similar issue with my project. What worked for me was to delete all reference to my project on the DerivedData folder. So, in your case:
rm -rf /Users/sparky/Library/Developer/Xcode/DerivedData/RKCatalog-*
After this, try restarting XCode.
You can easily clear Xcode's derived data folder using the keyboard shortcut:
⌘ + option + shift + k

Resources