'Framework not found' in Xcode - ios

I know this has been asked a couple of times. I followed instructions from these ones:
Adding frameworks to project in Xcode 5 and having *relative* paths added
xcode4: Linker error: Directory not found for option
Still Xcode is giving this error:
Here's my current configuration:
The bolts framework is so I can use the Parse SDK. I downloaded the blank project from here: https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new
It's working. I tried to copy every config option, but it still doesn't work.

Try deleting Bolts.framework from linked framework and re-add it. Also, in your Framework Search Path keep path until Bolts.framework like $(PROJECT_DIR)/Bolts if it is inside Bolts folder at your project directory path.

I'm pretty new to iOS development. Apparently this problem for me was a result of opening the .xcodeproj Xcode project instead of the .xcworkspace Xcode workspace. I opened the workspace instead and the error has gone away.

error: Framework not found
If you use CocoaPods try to run:
pod deintegrate
pod update
Also use .xcworkspace instead of .xcodeproj

Delete the framework link from the Xcode project setting.
Move the framework to the Project Folder.
Re-add the framework in the Xcode project setting.
clean the project and re-compile it.

delete all frameworks from Embedded Binaries and re-add it

me too was getting this error , I moved the framework file to the root project folder and added to framework again and problem is solved.

1:- Delete the framework from the Xcode project. Quit the Xcode.
2:- Open your project in XCode and go to file under Menu and select Add files to "YourProjectName".
3:- Select "YourFramwork.framework" in the directory where you keep it.
4:- Click on the Copy items if needed checkbox.
5:- Click Add.
Make sure that you have the framework added in both Embedded Binaries and Linked Frameworks and Libraries under Target settings - General. As shown in the following images:-

Here is the solution :
Turn the "$(PROJECT_DIR)" attribute(might be non-recursive by default) into recursive option in Select Project Click on Targets Click - Build Settings Search for 'Framework Search Path' - Double click the input.
Scratched from https://stackoverflow.com/a/31298214/4493512

Besides from removing the framework from the Podfile and Linked Frameworks and Libraries, I also had to remove the reference to the framework in Other Linker Flags.

I just had the same situation (was having a hard time to address the OP's build error after adding a 3rd party framework) and it seems like a bug in Xcode (mine is 8.3.2 (8E2002)).
The problem was that a folder name in path to the framework contained spaces. In this case, Xcode incorrectly escaped them with backslashes like this in Build Settings -> Framework Search Paths:
$(PROJECT_DIR)/Folder\ with\ spaces/Lib
To fix this, just manually edit the entry to remove those backslashes and enclose the whole string in quotes like this:
"$(PROJECT_DIR)/Folder with spaces/Lib"

Delete the framework that is causing the issue (by removing the reference).
Then add it again, following these steps for adding FBSDK frameworks and libraries:
click project
general settings
linked framework and libraries
click the plus button and add all that you want

None of the above worked for me until I found that I had a blank "Any Architecture | Any SDK" line underneath Framework Search Paths / Debug under Build Settings.
Deleted the line and it works!

Error: Framework not found
If you use CocoaPods try to run these commands from terminal:
Intel chip:
pod deintegrate
pod update
Apple Silicon M1 chip:
pod deintegrate
arch -x86_64 pod update
Also use .xcworkspace instead of .xcodeproj

When this error occurred to me was because Pods folder was in iCloud and had no local copy on my computer. Go to your project's folder in Finder and check if there is iCloud's symbol in any of the folders inside it!

I realised that I hadn't run/built my framework with the Generic Device, which strangely lead to these issues. I just put the framework back in and it worked.

If you are using CocoaPods. Similar thing has happened to me. Although this question is old someone like me might still be struggling. So for to help:
after pod install it warns you about project files. I didn't notice till now. it says:
[!] Please close any current Xcode sessions and use
ProjectFile.xcworkspace for this project from now on.
So basically, do not continue working on .xcodeproj after installing Pods. If you do linker won't find files.

My framework has long name like FrameworkSDK_Light-1.0.6.framework so I renamed it to FrameworkSDK_Light.framework and it solved my problem.

I got the error 'AdBrixRM framework not found'. I checked the AdBrixRM.framework. I noticed that 'AdBrixRM' excution file is missed. I copied this file into the framework folder and the issue was gone.

I used to encounter this same exact issue in the past with Google Admob SDK. Most recently, this happened when trying to add Validic libraries. I tried the same old good trick this time around as well and it worked in a jiffy.
1) Remove the frameworks, if already added.
2) Locate the framework in Finder and Drag & Drop them directly into the Project Navigator pane under your project tree.
3) Build the project and Whooo!
Not sure what makes the difference, but adding the frameworks by the official way of going to the section "Linked Framework & Libraries" under project settings page (TARGET) and linking from there does not work for me. Hope this helps.

I found that the file.framework was referencing a file outside my project. So I dragged the file into my frameworks folder under my project and then got rid of the earlier file.framework file and it worked.

add github "BoltsFramework/Bolts-iOS" on your cartfile.
then carthage update.
after copy Bolts.framework from ../carthage/Build/iOS

Switching from iOS simulator to real device solved the problem for me.

Was facing the same error and solved it ---> Build Settings > Build Active Architecture Only = Yes

Please after adding both framework also open each Bolts and Parse framework and add Parse and Bolts to the project then problem will be solve

Running pod update in the root directory of the app fixed the issue for me.

If you are developing one module using cocoapods, try to comment the line
s.vendored_frameworks = "YOURMODULE.framework"
on YOURMODULE.podspec
The error will disappear after you generate and copy your YOURMODULE.framework to your project folder.

I had this issue on one of the project i worked, before you delete and readd the framework do a:
git status
on your project and check to see if the framework is not listed as deleted. In the event that it is either do a
git stash
or
git checkout *framework/file/path*

Related

ld: library not found for -lCocoaAsyncSocket - React Native

I have created a new react native project and when I try to run the app within an iOS emulator it always crashes.
When I open the .xcworkspace within Xcode I get the following error.
I have tried to update the search paths but this has not worked, I have also tried to reinstall pods but this hasn't worked.
This must be fixed on the framework side, however, the solution is the following steps:
On the Xcode bring the Build Settings tab
Find the Search Paths and then try to modify Library search paths
Add ${inherited} to the first of the list. It's important to be the first
Delete the build folder inside the ios folder of the project
Try to run the project again
It must fix the issue
This issue is basically related to the wrongly linking classes. Please follow these steps:
check make sure, you have install all the pods.
Please check your .js files, and check your import statements. To be make sure , every import statement package is installed in your project
clean project
Rebuild again
I can see that you state you have already checked search paths, but I had this same issue, and it was resolved by adding "${PODS_CONFIGURATION_BUILD_DIR}" as recursive to my Library Search Paths, under <Project> > Build Settings > Library Search Paths. However, now I'm stuck on the linker instruction -lcrypto, so it's not a complete solution.

symbol(s) not found for architecture arm64

Facing ObjC file reference issue. I tried pod deintegration, removing DerivedData, Cleaning the project, Adding -Objc and $(inherited) FLAGS.
I am using cocoapods, Xcode 9, Swift 4. Please revert if anyone have resolved this issue.
I had same issue make your your ".m" implementation files are assigned to the Target Membership:
For me none of these answers worked, and appeared to cause more problems.
My solution was in terminal trying "pod install" It added a missing file for me and everything was good to go
Try this
Goto Project -> Build setting
Serach enable bitcode & set it to NO
Check for the AppDelegate and OnBoardingViewCtontroller file in your project.
Just delete to and add it again. When your are adding it again make sure that Copy If needed option is checked
This is bcoz if your uncheck this check box then the file reference is created and if you move project the you will get this error.
Check Your Pod file that is it targeting your App Target?.
May be Pod is not targeting your App Target.
This error occurs when you have reference of File or Framework that is not included in Target.
change the Build Configuration from Debug to Release.
Edit Scheme... -> Info -> Run -> Build Configuration
Try Build Active Architecture Only to NO:
You need to add necessary framework to your project. Check all third party party framework and search its required framework for support. For e.g. if you add google analytic then you need to add CoreData , Foundation etc framework. There is some framework is missing for which third party framework needs.
Or you can-
Press "Cmd+Shift+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
Hope this will solve your problem.
Pods for UITest and Test projects for the pods was causing the issue. Check for it.
Check if there are certain function which are declared in .h file but are not implemented in implementation file and they are being called from another class.
It should be -ObjC, not -Objc. Note the upper case C.

Xcode 8 beta 4: Build fails with "The following binaries use incompatible versions of Swift:" error

With new Xcode 8 beta 4 we started experiencing the following error during CopySwiftLibs build phase:
Effective srcDirs: {(
<DVTFilePath:0x7f865961e970:'/Volumes/Data/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator'>,
<DVTFilePath:0x7f8657d02b20:'/Volumes/Data/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphonesimulator'>
)}
error: The following binaries use incompatible versions of Swift:
/Users/user/Projects/git/iphone-swift-1/DerivedData/myApp/Build/Products/Debug-iphonesimulator/myApp.app/myApp
/Users/user/Projects/git/iphone-swift-1/myApp/myAppApi.framework/myAppApi
myAppApi is a subproject in the workspace that contains some shared code (it uses Alamofire).
One thing to note: originally we converted project from Swift 2.2 to Swift 2.3, and then manually upgraded to 3.0.
Does anyone have any idea what might be causing this error?
Thanks!
I had the same problem, but managed to fix it by:
Clean the project.
Close project and quit Xcode.
Clean derived data.
Open the project again and it's there, all nice and working.
I did this on Xcode 8 using Swift 3.
You can also get this problem, if you have the scenario of your container app's code is Swift 2.3 and you're creating a new extension in Xcode 8.
To solve the above scenario...
Note: All code has to be in the same swift (compatible) version to compile without failure.
That being said, one way you could solve this problem is by sticking to Swift 2.3 and then setting your Extension Target's Use Legacy Swift Language Version to "Yes".
You can find that option while Xcode 8 is open as follows:
Select your app project root in the Project Navigator (on the left-hand side)
On the right-hand side, select your extension under the TARGETS
section
Once the extension is selected, click on the Build Settings tab
Scroll down and find Use Legacy Swift Language Version and set it
to Yes from its drop-down menu.
You can now build the project
Note: You might need to fix the overridden code in the extension templates since they were originally in Swift 3.
Before doing anything...
(If you can use Xcode 8.0-compatible with your project)
By default your project is set to Xcode 3.2-compatible
Select your app project in the Navigator (on the left-hand side)
Select Project Document in the Utilities Panel (on the
right-hand side)
Change Project Format to Xcode 8.0-compatible
Try to build your project.
If it doesn't work, try the other solutions proposed.
Note:You can even switch back to Xcode 3.2-compatible after fixing the error and it should work, but you "might" have other build problems later.
Recommendation:
Before debugging an existing project. Close your project and zip a copy of your project file if you did not create a Git repository when you created your project.
I just had the same problem after updating Xcode to 9.3. I fixed the problem simply by just cleaning the build folder. You can do this with Command-Option-Shift-K or in the option menu "Product" -> "Clean" (see screenshot)
I fixed this by deleting the embedded binaries in the project. To do this:
Open your workspace/ project in Xcode.
Navigate to the actual project file (with the General, Capabilities, etc. ribbon).
Go to General > Embedded Binaries, remove by selecting on the ones you don't want and then clicking the minus sign.
Note 1: You shouldn't have to delete them from the "Linked Frameworks and Libraries" section (they should automatically be removed when you remove them from the "Embedded Binaries").
Note 2: I have a lot of dependencies and am using CocoaPods. I have nothing in the "Embedded Binaries" and only the "Pods_[YourApplicationName].framework" in the "Linked Frameworks and Libraries" section.
I had various libraries integrated via carthage. However during the process I switched some of them to cocoapods and forgot to remove the old .frameworks file from the project target.
Removing them solved the build error.
I had the same problem.
My solution was to rename the 'myApp'-directory to 'myAppmyApp' and then I ran the app again. A new 'myApp'-directory was made a the app did run very well again on my iPhone.
A difference with your situation might be this: the name of my app, let's say 'myApp' in the directory 'DerivedData' was myApp concatenated with: '-'
Maybe this will help you.
You need to switch all the dependencies to swift 3.
In your case, Alamofire need to be switched to Swift 3 branch
I had the same error message after adding a Swift 3 version of a framework.
My target framework search path was still configured to find both swift 2 and swift 3 version of the same framework, so my project got stuck on swift 2.3 version.
For me, the solution has been to remove the old framework from my project directory and delete its folder reference from the framework search path.
So I just post the solution I found so far after an hour debugging.
Since Xcode 9, this can be tracked by the compiler log.
If you scroll down to the bottom of the compiler log, you will find this issue is caused by type checking crash.
Just had this pop up after upgrading to Xcode 10.2 ... one of my pods uses Swift.
Fix was to:
pod repo update
rm -rf Pods
pod install

ld: framework not found Parse Xcode 7 beta

I succeed to install and use Parse framework with my new project, but I can't with a "template project".
The template is just a Slide Menu from Appcoda
You can download the project here.
I have this error :
ld: framework not found Parse
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And the same for Bolts.
I don't understand what the problem is, the initial project is just some View Controllers...
When I write the code "import Parse", the error message is :
No such module 'Parse'
I tried to drag and drop the frameworks, and also to add the frameworks in "Link Binary With Libraries".
PS : I am using Xcode 7 beta, and I tried on beta 1 and 2, same issue.
Here is the solution:
There seems to be an issue with Xcode 7 beta where the search path for manually added frameworks is missing.
To fix the issue add the search path by doing the following:
Select Project
Click on Targets
Click Build Settings
Search for: Framework Search Path
Add $(PROJECT_DIR) and choose Recursive option.
The project should build now.
Thanks to this post : Link to stack
None of the proposed solutions worked for me. Eventually I found that the solution was to drag the frameworks from a source folder that did not have spaces in it's name.
E.g.
Dragging the frameworks from 'iOS SDKS' > did not work
Dragging the frameworks from 'Downloads' > worked
It's not the first time that XCode has been shown to be problematic when working with paths that contain spaces.
Ensure that Parse is included in the "Link Binary With Libraries" section under "Build Phases".
Go to your Build Phases -> Linked Binary With Libraries remove your pod framework & add it back again. That does the trick.
Even I got the same issue. In my case, somehow there were multiple frameworks added to the project, and one of the framework is empty. After removing the empty framwork it started compiling.
This can also happen if you accidentally break your framework, e.g. if the framework contained an Alias, which is no longer there.
This can happen if you zip the file, as the Alias contains a direct link to the orignal file, and isnt updated when you move the zip. E.g. in my case I recieved a zip of the opencv framework, and inside it had just the 'Versions' folder and no aliases to Headers, Resources or the binary. You can just recreate the aliases, or compile the framework from source again.
This took a while to figure out!

Could not build module 'FBSDKCoreKit' For FacebookSDK 4

I am having issue while updating Facebook SDK 3 to 4
when I add the framework it was added successfully. but when i add header file it's having the error that " Could not build module 'FBSDKCoreKit' ". Don't know the reason.
In setting the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings solved the problem for me. but don't know if is there any problem or issue or any side effects of it.
Its Facebook Bug you can check the solution they are providing in this link.
Update 1
Facebook said that they have fixed and will apply solution in next update see this link
Update 2
FaceBook Fixed It in Version Latest version (i.e. 4.1.0) see this link link.
i have also facing same issue and i got solution. Nothing do just Remove the Module folder in. Follow simple step
step 1. go to Document/FacebookSDK folder
step 2. Go inside FBSDKCoreKit.framework folder & remove Modules folder. then drag and drop in your Xcode Project.
Resolve your issue. Enjoy .... !!!
I have tried the above solutions but did not work for me.Finally after scratching head for sometime i came across below solution:
I changed my framework search path after which my issue was resolved.
Steps to find Framework search Path
Goto build setting of the project and search for framework search path.
Then add the below line
"~/Documents/FacebookSDK"
.....
I hope this will help someone .
If your using cocoapods, go to Pods Project Build Settings and change "Allow Non-modular Includes in Framework modules" to YES
When adding Facebook SDK (Version 4) files to the project make sure to uncheck "Copy into destination group folder".
This solved a problem for me.
Facebook has recognized the issue and said they're working on a fix.
In the meantime, here is the link to the available solutions depending on your project.
The updated FacebookSDK v4.1.0 launch on 30th April 2015 solved the following issue.
You might face a warning. Go to FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h and add #import < FBSDKCoreKit/FBSDKTestUsersManager.h > to fix it.
I got the same issue and solve problem.
My solution :
1. follow the steps from https://developers.facebook.com/docs/react-native/getting-started-ios
2. check the xcode proj -> Library, find and open file RCTFBSDK.xcodeproj then update fb sdk path in build setting->Framework search path.
It works. I guess that sometime the RCTFBSDK.xcodeproj in Library can not update the framework search path from main xcodeproj so we need done manually. Hopefully my solution can help you, Thanks.
And also this issue happens if you are open .xcodeproj file instead of .xworkspace file.
change In target setting "Allow Non-modular Includes in Framework modules" to YES
With me, just download new version of Facebook SDK, then remove the old and add new fixed the problem.
If you have multiple targets in your project, make sure that the "Target Membership" for the required frameworks is ticked for the target you're trying to build for.
When you drag the frameworks into XCode, you can usually choose the target, but it's an easy thing to miss.
I faced the same issue, but i was running project on old Xcode version. Make sure you are using latest SDK with latest Xcode version.
As In My Case, The problem was caused by cocoapod configs, I just updated the cocoapod version to 1.5.3 (currently it's the latest version) by using the following command:
sudo gem install cocoapods
Then, I simply updated all the pods I use.
pod update
Then voalá, the error is gone.

Resources