How to remove wrong path from $(inherited) at the project level? - ios

I' getting linker warning when I try to build the project:
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks'
I double checked framework search paths and it looks like $(inherited) contains invalid path. There's no such folder "Framework" in ".../Xcode.app/.../Library" - there are "GPUTools", "PrivateFrameworks" and "Xcode" folder. Of course this causes this warning to appear. Currently I'm trying to understand how Xcode creates this variable. Any ideas how to fix/remove wrong path from $(inherited)?
UPDATE I'm still using Xcode5, and cocoapods.

if you take a look at the project level build settings for the Framework search paths, this is where the target inherits from. Provided you do not manually provide these settings from a config-file, in that case you must fix it in that config-file.
UPDATE: When you use cocoa pods, you should remove the $(inherited) flag and let cocoa pods control this. You could delete everything cocoa pods-generated, except for your pods-file, and remove $(inherited) from your targets configuration, and rerun pod install. This should clear things up for you.

Cocoapods was not automatically controlling this field for me. I had to delete the line, go to the framework folder created by Cocoapods, Get Info, then copy-paste the "where" field. Then it worked.

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.

iOS app with FB SDK reporting FBSDKCoreKit/FBSDKCoreKit.h file not found

I am trying to use the FB SDK with an iOS app, and have added the .framework files to my Frameworks group. I also have added /Users/$(USER)/Documents/FacebookSDK to my search path.
I am getting an error when building: FBSDKCoreKit/FBSDKCoreKit.h file not found
This is accurate, because /Users/$(USER)/Documents/FacebookSDK/FBSDKCoreKit/FBSDKCoreKit.h does not exist.
Instead, the file is at: /Users/$(USER)/Documents/FacebookSDK/FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h
What am I supposed to do about this? (Or what am I doing wrong?)
I followed the instructions at https://developers.facebook.com/docs/ios/getting-started/
Remove all facebook framework then after 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 then add facebook framework
$(PROJECT_DIR)
May be it will help you.
OR
You have duplicate symbol method which means there are duplicate file in project
In your Target's Build Phase, under "Compile Sources" check if there are duplicate file and delete one if you have duplication.
Hope this will help you.
sometimes the libraries does not get grabbed by Xcode, Try cleaning the project
Try with $(inherited) and non-recursive in library search paths for project target in Build settings.

'Framework not found' in Xcode

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*

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!

Resources