symbol(s) not found for architecture arm64 - ios

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.

Related

Xcode 10 beta: linker command failed with exit code 1 RPSystemBroadcastPickerView [duplicate]

An Xcode beginner's question:
It is my first experience with Xcode 4.6.3.
I am trying to write a very simple console program, that searches for paired BT devices and prints them to an NSLog.
It builds with the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_IOBluetoothDevice", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I searched like crazy. The common problem should be a reference to a file, of which only the header files are imported and no implementation (*.m-file) is found by the linker. The IOBluetooth library is however, a standard Framework like the Foundation Framework.
What am I missing in my above statement?
I also have tried building it for a 32-bit machine (build fails again). It is clearly a linker error, however I have no idea, to what it relates, except that there is an issue with finding the implementation for IOBluetoothDevice, on both x86 and x64 architecture, while the header files are from a standard included Framework, called IOBluetooth?
For your information my main code "main.m" being:
#import <Foundation/Foundation.h>
#import <IOBluetooth/objc/IOBluetoothDevice.h> // Note the import for bluetooth
#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h> // Note the import for bluetooth
int main(int argc, const char * argv[])
{
#autoreleasepool {
IOBluetoothDevice *currentDevice;
NSArray *devices = [ IOBluetoothDevice pairedDevices];
for (id currentDevice in devices){
NSLog(#"%i : %#",[ currentDevice classOfDevice ], [ currentDevice name ]);
}
}
return 0;
}
Thanks for any help or pointers to the right direction.
It looks like you are missing including the IOBluetooth.framework in your project. You can add it by:
Clicking on your project in the upper left of the left pane (the blue icon).
In the middle pane, click on the Build Phases tab.
Under "Link Binary With Libraries", click on the plus button.
Find the IOBluetooth.framework from the list and hit Add.
This will make sure that the IOBluetooth.framework definitions are found by the linker. You can see that the framework is a member of your target by clicking on the framework in the left pane and seeing the framework's target membership in the right pane (note I've moved the framework under the Frameworks group for organization purposes):
UPD
Apple requires to use arm64 architecture. Do not use x32 libraries in your project
So the answer below is not correct anymore!
Old answer
The new Xcode 5.1 sets the architecture armv7,armv7s,and arm64 as default.
And sometimes the error "build failure “Undefined symbols for architecture x86_64”" may be caused by this. Because, some libs (not Apple's) were compiled for x32 originally and doesn't support x64.
So what you need, is to change the "Architectures" for your project target like this
NB. If you're using Cocoapods - you should do the same for "Pods" target.
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_xxx",
referenced from:
objc-class-ref in yyy.o
This generally means, you are calling "xxx" (it may be a framework or class) from the class "yyy". The compiler can not locate the "xxx" so this error occurs.
You need to add the missing files(in this case "xxx") by right click on your project folder in navigator window and tap on "Add files to "YourProjectName"" option.
A popup window will open your project files in Finder. There, you can see the missing files and just add them to your project. Don't forget to check the "Copy items if needed" box. Good luck!!
I have also seen this error on Xcode 7.2 when the derived data becomes corrupted (in my case I interrupted a build and suspect that was the root cause).
So if the other solutions (notably Chris's and BraveS's which I suspect are more likely) do not fit your problem try deleting derived data (Select: Window / Projects / Derived Data -> Delete) and re-building.
(Added for reference by others - I know the original question has been answered correctly).
Under Xcode 9.0b5 you may encounter this because Xcode 9.0b5 has a bug in it where when you add source code, it does not honor the target settings. You must go in and set each file's target manually afterwords:
In my Case , it was not a library, it was some classes ..
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassNmae", referenced from: objc-class-ref in
SomeClassName" . . .
d: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
Solution
I had several targets in Xcode with several schemas ( Production , Dev etc ) .. some of my newly added implementation ( Class.m ) were missing in
Xcode->Targets->Build Phases->Compile Sources
So I had to add them manually.
then I could compile & build successfully.
I also encountered the same problem , the above methods will not work . I accidentally deleted the files in the following directory on it .
Or
~/Library/Developer/Xcode/DerivedData/
I tried just about everything here but my problem turned out to be the remnants of a previous cocoapods build. What worked for me was:
rm -Rf Pods; pod install
Delete Derived Data (Window/Projects... select your target. click Delete Button)
Rebuild
I have faced this issue many times. This usually comes when you delete your build folder.
The easy solution is to de-integrate and install the pod files again.
pod deintegrate
pod install
When updating to Xcode 7.1, you might see this type of error, and it can't be resolved by any of the above answers. One of the symptoms in my case was that the app runs on the device not in the simulator. You'll probably see a huge number of errors related to pretty much all of the frameworks you're using.
The fix is actually quite simple. You just need to delete an entry from the "Framework Search Paths" setting, found in your TARGETS > Build Settings > Search Paths section (make sure the "All" tab is selected)
If you see another entry here (besides $(inherited)) for your main target(s) or your test target, just delete the faulty path from all targets and rebuild.
I have found this can also occur if you drag a folder with Objective-C files into your project. If that folder appears blue I think it indicates its not properly linked. You can verify this (if you use version control) because whenever you add new files the pbxproj file should update with links to those new files. However you may find that after you added a folder that the pbxproj file did not change (and hence there is a linking error). So you will get auto-complete working and it will find the classes you imported, but when it goes to actually build the image it fails with this error code.
The solution is to not add the folder but rather add the files. Do this and you should see the pbxproj file update and it should fix this error.
This also assumes you've done what was suggested above and have properly linked all the right frameworks.
I know it's an old question but today got the same error and non of the above solutions worked.
Have fixed it however by setting option:
Project -> Architecture -> Build Active Architecture Only
to Yes
and project compiles and builds properly
I had the same error, because instead of deleting a file I simply removed references to it. Locating the file in Finder and removing it helped.
In my case, I built a custom framework with Deployment target set to 9.1, but the Deployment target of my app was lower, which supports 8.1. Minimize the custom framework Deployment target solved my problem.
If you're getting this error when trying to link to a C file, first double check the function names for typos. Next double check that you are not trying to call a C function from a C++ / Objective-C++ environment without using the extern C {} construct. I was tearing my hair out because I had a class that was in a .mm file which was trying to call C functions. It doesn't work because in C++, the symbols are mangled. You can actually see the concrete symbols generated using the nm tool. Terminal to the path of the .o files, and run nm -g on the file that is calling the symbol and the one that should have the symbol, and you should see if they match up or not, which can provide clues for the error.
nm -g file.o
You can inspect the C++ symbols demangled with this:
nm -gC file.o
I got it solved by adding "-lc++" in Other Linker Flags in Build Settings.
In my case problem was compiled framework architecture.
I'm running Xcode 11 and using Swift 5.1
I had 3 target like:
MyApp
MyAppTests
MyAppFrameWork
I was tried to run tests but MyAppFrameWork product was compiled for Generic iOS Devices and the Test target needed an arm x86-64, So I rebuilt Framework for iOS Simulators and test cases successfuly start running.
This is also happend with apple M1 chip.
Here is my solution just check Open using Rosetta
Steps:
Go to application > right click xcode > get info > check Open using Rosetta
Restart the system.
I am late to the party but thought of sharing one more scenario where this could happen.
I was working on a framework and was distributing it over cocoapods.
The framework had both objective c and swift classes and protocols and it was building successfully.
While using pod in another framework or project it was giving this error as I forgot to include .m files in podspec.
Please include .swtift,.h and .m files in your podspec sources as below:
s.source_files = "Projectname/Projectname/**/*.{swift,h,m}"
I hope it saves someone else's time.
in my case I had to add
target 'SomeTargetTests' do
inherit! :search_paths
end
to my podfile and then delete the /Pods directory and run `pod install`
(Xcode 10.1)
This might help somebody. It took me days to finally figure it out. I am working in OBJ-C and I went to:
Project -> Build Phases -> Compile sources and added the new VC.m file I had just added.
I am working with legacy code and I am usually a swifty, new to OBJ-C so I didn't even think to import my .m files into a sources library.
EDIT:
Ran into this problem a second time and it was something else. This answer saved me after 5 hours of debugging. Tried all of the options on this thread and more. https://stackoverflow.com/a/13625967/7842175 Please give him credit if this helps you, but basically you might need to set your file to its target in file inspector.
All in all, this is a very vague Error code that could be caused for a lot of reasons, so keep on trying different options.
What helped me was adding s.static_framework = true to my /podspec in the project that was throwing the error.
For me, this started to happen after merge conflict.
I tried to clean and remove build folder, but none of it helped. This issue kept happening regardless. Then I relinked the reference by deleting the groups that was problematic and re-added to the project and it worked.
Could also be an #include <windows.h> in the .c file that you're trying to compile.
Sometime, I forget to copy library from Release-universal and mistakenly copy from Release-iphoneos. Usually Release-iphoneos contains .a file which has been pruned for X86. and so it gives the error.
in my case, removing selection of target membership and then select again fix the issue.
Check William Cerniuk answer with the attachment photo.
Undefined symbols for architecture x86_64
I have run on this issue when used CocoaPods with some dependency which did not have specific version, that is why after pod update it downloaded the latest version which included some breaking changes
Upgrade dependencies and code for using them
Set specific version of pod
Remove Derived Data[About] folder
In my case I was getting this error: Undefined symbols for architecture x86_64: "_OBJC_CLASS _ $ _ RCTImageLoader"
And I was able to fix it by adding the following line in my Podfile file:
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
Reference
It happens when you are using architecture arm6, arm7 in your current project but any 3rd party framework which you are trying to consume in your project is built over x86_64.
For e.g If you are using Cocoa Pods in your project, then you need to add following script to make sure all 3rd party frameworks ensure arm6, arm7. i.e
Sample podfile with script to be add at end
target 'XYZ_ProjectTarget' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for XYZ_ProjectTarget
pod 'pod_name'
target 'XYZ_TargetTests' do
inherit! :search_paths
# Pods for testing
end
target 'XYZ_TargetUITests' do
# Pods for testing
end
end
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ARCHS'] = 'armv7 armv7s'
end
end
end

Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

I can't get rid of this error!
I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data folder in Finder->right-click, move to trash), cleaning the project(CMD+Shift+K or Product->Clean), updating carthage and dependencies, checked other answers on StackOverflow (mostly adjustments in Build Settings/Phases), and recloned the app from github, etc.
The same project works on my collaborators computers..
EDIT:
From the current top-rated answer, I was able to debug a little further...I am still not sure how to fix though. It looks like I have something in the project twice? I looked and can't find anything showing up twice!
Here's a picture of the log:
i was facing same issue today in xcode 8 version 8.3.2
right click on issue --> reveal in log
then you are able to check what is causing that issue
Maybe you installed a pod file and you are still trying to build from the .xcodeproj file instead of .xcworkspace
the only thing that worked for me was to run pod deintegrate and pod install
did you try a clean? cmd + shift + k
Okay...So here is what solved my problem...
in App Delegate File:
#import "AppDelegate.h"
#import "DarkSkyAPI.h"
//#import "Credentials.h"
I had imported Credentials.h already in the DarkSkyAPI.m file in my project. Commenting out the extra import made the error go away!
Some things to mention and maybe help anyone in the future. #umairqureshi_6's answer did help me along the process, but did not solve it. He led to where I was able to dig out the info. I kept seeing AppDelegate and DarkSkyAPI files showing up in the error log and the information it was pulling from Credentials file was causing the error. I knew it had to be in one of these 3 files, so I immediately checked imports, because I remembered hearing that the .h carries all the imports from its .m file. Boom!
I k now the question has already been answered. But if this helps somebody save some time :
I had the same error. I checked everything to find a very small and stupid mistake from my side. I imported a core data ManagedObject custom file in a view controller of my project. I accidentally imported the .m file instead of the .h file which was causing the duplicate symbol in architecture error (linker command failed) because my .m file of properties class imports the .h file of core data class and hence causing duplicate import.
So just check if u have imported the right files before you try multiple solutions.!
A lot of solutions are mentioned above. No one worked for me(but please try above first).
Select Project -> Select Target -> Linked Framework and Libraries -> Add all pod libraries . (remove if they exist in embedded binaries)
Now remove these from Framework Folder in left file explorer of xcode.
This solved my issue.
Select the project-> Build Phase->Link Binary with libraries and add all pod libraries.
I had the same problem using Carthage for dependencies.
Just go to Select Project -> Build Settings -> Search for Enable Bitcode -> If it is selected to Yes, select No.
That solved this problem for me.
In my case the reason of the error is library which was linked two times.
I use react-native so it was linked automatically using react-native link and manually in xcode.
I had same problem.
The cause was that I declared same global variable in 2 files. So it was showing same error saying 2 duplicate symbols.
The solution was to remove those variables.
For any one having this issue with Flurry framework. This is what fixed my issue.
For me the issue was that i had imported the following files but never used them.
"libFlurryTVOS_9.2.3"
"libFlurryWatch_9.2.3"
So all I had to do was go to project target settings and remove these 2 files from the "Linked framework and libraries" section and the problem was solved.
Make sure the Find Implicit Dependencies checkbox is checked.
(Product -> Scheme -> Edit Scheme -> Build -> Find Implicit Dependencies)
I was testing the Sparkle framework with CocoaPods.
Sadly, I put pod 'Sparkle', '~> 1.21' in the PodFile in the wrong place. I put it underneath Testing (for unit tests).
Once placed in correct spot in PodFile, everything's fine.
I just had to do import Foundation!
I was using Kitura for Swift server side and kept forgetting this!
Here is my problem and solution:
I removed two files from the source code using source tree(Version controller). After applying the diff, that contains the two classes I removed, Xcode didn't add it automatically. So I got linker error.
I manually added the files, by right click on group name and select "Add files to ". Now my error got resolved.
If anyone faced the linker error regarding class file, then try to add it manually.
Did not have this problem when I built and ran on my own device. Only had this problem with simulators. I just simply restarted my computer and ran it. It worked.
In my case I have change the Target name in my Podfile So it's create the same Error for me.
Solution
Just go project-> Build Phase->Link Binary with libraries Remove the old FrameWorks by click on minus button(-) And clean and Run again. It's work me.
Remove Unwanted .framework.
The other answers didn't work for me so here I share my solution in case it might help somebody else:
My problem was that I was configuring the Podfile of my XCode-Project for the wrong platform. Changing "platform :ios" at the beginning of my Podfile to "platform :macos" worked for me to get rid of the error.
I had the same problem. If you are checking out any github project, then instead of using git clone, use git lfs clone, as sometimes, some large files are not properly cloned by using git only. Also, make sure your bitcode is disabled.
For me, the gem lock file was specifying an older version of cocoapods than the one I had installed. I had to re-branch and run bundle exec pod install instead of pod install
It seems like the issue is different for most of us, and the error message has decent info. In my case, the Deployment Target was set to 10.13 by the export MACOSX_DEPLOYMENT_TARGET=10.13 line, but I was running 10.14. So I had to switch my Deployment Target to 10.14 in General > Deployment Info, in order for the ITLibrary-related symbols to be available again.
cd /Users/foo/src/scrobble/macos/itunes-scrobble
export MACOSX_DEPLOYMENT_TARGET=10.13
... SNIP ...
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ITLibMediaItem", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ITLibPlaylist", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_ITLibrary", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my case, I was producing multiple products from the same project. For one of the products, the main.m file imported a header file from another folder under the same project. But that file was not included in "Complied Sources" under "Build Phase". This caused a linker error.
After carefully comparing the "Build Phases" settings for a product that could be built successfully, I realized that the .m file of the header needs to be included in the list of "Compiled Source". My issue was resolved after adding that file. Attaching a picture for clarity. The highlighted file had to be added.
One of the reasons of this problem might be "Build Active Architecture Only". You need set to true.
IOS version in build phases of pod(in xcode) and ios version in pod file should be same (Try with 9.0)
Ok, I had the same problem just today and started googling it, when I came across this thread. I haven't finished reading the question when the answer struck my mind:
I declared a class with an empty constructor
class MyClass{
MyClass();
void func_one(){
// code
}
void func_two(){
// code
}
~MyClass(){
cout << "Deleting object" << endl;
}
};
Then I thought why not terminating (not sure if I'm correct with word selection here, but who cares) the constructor of my class with curly braces ({}). So I did:
class MyClass{
MyClass(){}
void func_one(){
// code
}
void func_two(){
// code
}
~MyClass(){
cout << "Deleting object" << endl;
}
};
The problem eliminated, my code started working perfectly.
I know, the good practice is to investigate the issue and find the real cause, but this worked for me.

'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*

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.

Restkit/Restkit.h file not found Xcode 6.1

I was working on Project in Xcode 6.1. It was working fine and all of sudden it prompted an error 'Restkit/Restkit.h file not found'. I'm getting error after changing Architectures from $(ARCHS_STANDARD_32_BIT) to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD) which is recommended by Apple Check Link
I have tried following approaches :
1.'Cleaning' project and rebuilding
2. Checked for missing framework in Target -> Build Phases
3. Fixed 'Framework Search Path' of Target
4. I have build Restkit XcodeProject and Targets separately. It builds without error.
I was getting below error while submitting to App Store and hence changed architecture to 'Standard architecture'
Why did this occur all of sudden? How to fix it?
Just to be here. There is similar issue in newest Xcode 7+. You can observe "RestKit/RestKit.h file not found" failure on archive build. You could compile and run apps on emulator but archive would fail.
To fix this you need to add one line to "Header Search Paths" in Build Settings:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
Be sure to include the surrounding quotes.
You have not properly changed Architecture , if you have done properly than it will show you like this,
Proper Architecture setting:
So again properly change Architecture and try again.
This is your Architecture Setting
I had used third-party static library in project named libNuance.a. It seems that this static library works fine for 32-bit architecture but failed for 64-bit architecture.
I downloaded updated version of libNuance.a library from their official site and changed architecture to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD).
Vola! build succeeded without any error.
First you can try, look for it in project navigator(left side) and delete if it is red.After that add the RestKit again.Be sure when adding check the copy if needed box and packages contains headers.
Also you may try just #import "RestKit.h"
I had solved this in many cases by deleting the contents of DerivedData folder. See the following questions on how to do this:
Can I safely delete contents of Xcode Derived data folder?
How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?
If you have Pods configured then and if you have upgraded recently your Xcode, try reinstalling cocoapod and all the reinstall all required pods.
I fixed this issue, to change the Header Search Path
"$(SOURCE_ROOT)/RestKit-RestKit-c19a500/Build"
Note : "RestKit-RestKit-c19a500" this is my RestKit folder name.

Resources