Undefined symbols for architecture arm64
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
- Creating IPA file in Xcode 5 for project containing static library sub-projects
- can not Load project workspace Integrity error in xcode 5.1.1?
- Using Core Plot 2 in an Xcode 5 project
- iPhone 4" screen with xcassets not pulling correct image
- Is it possible to ctrl-drag in Storyboard to set a UINavigationControllerDelegate?
- how to stop xcode5.1 building for 64bit
28 Solutions Collect From Internet About “Undefined symbols for architecture arm64”
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 also encountered the same problem , the above methods will not work . I accidentally deleted the files in the following directory on it .
Set Architectures to armv7 armv7s, Build Active Architecture Only to NO, for every target in the project, including every one in Pods
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)
- 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.
some explanation 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 you build the fat universal binary
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.
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
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!
Other Linker Flags in Build Settings of the target solved the problem.
This might be related to
libz.tbd, just have to add it to your targets for the linking binaries, and try to compile again.
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:
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
In my case, I had to look for
C++ Standard Library and make sure that the
libc++ was the one selected.
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.
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’
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.
This solution is the only thing that worked for me:
go to CordovaLib settings and add arm64 to Valid Architectures.
I have facing the same problem after installing the AWS framework to overcome this issue,I have update the POD config file from your project which get created after installing AWS POD. Check config file as below
OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-AWSAutoScaling" -l" Pods- AWSCloudWatch" -l"Pods-AWSCognito" -l"Pods-AWSCore" -l "Pods-AWSDynamoDB" -l"Pods-AWSEC2" -l"Pods-AWSElasticLoadBalancing" -l"Pods-AWSKinesis" -l"Pods-AWSLambda" -l"Pods-AWSMachineLearning" -l"Pods-AWSS3" -l"Pods-AWSSES" -l"Pods-AWSSNS" -l" Pods-AWSSQS"-l "Pods-AWSSimpleDB" -l"Pods-Bolts" -l"Pods-FMDB" -l"Pods-GZIP" -l"Pods-Mantle" -l"Pods-Reachability" -l"Pods-TMCache" -l"Pods-UICKeyChainStore" -l"Pods-XMLDictionary" -l"sqlite3" -l "z"-framework "Accelerate" -framework "AssetsLibrary" -framework "CoreLocation" -framework "Foundation" -framework "ImageIO" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -weak_framework "UIKit" OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
if your config file not working properly then Set your Other Linker flag to $(inherited)
- Go to target Build Settings.
- set BUILD ACTIVE ARCHITECTURE ONLY = NO for both Debug and Release
- Build and run
If the architecture and linker settings look good, check your h files. My issue was the same error, but I had restructured the h files and I removed an extern statement. Other m files were using that variable, causing the linker error.
Adding “Security.framework” did the trick for me.
I know this is an old branch. However, the same problem started happening to me after migrating to the latest CocoaPods version (1.0.0) and trying to reinstall all pods. I encountered the “Missing symbols for armv64” linker error.
Oddly enough, I solved it by performing the following steps:
Remove all pods (pod init,
Rewrite the podfile in a reversed order (instead of:
Reversing the order of the dependencies in the podfile and rebuilding the pods has solved the problem.
- ios 8 – buttons in horizontal scroll view intercepting pan event – scroll does not work
- In iOS selected cell should move to top portion in UITableView
- How to represent money in Objective-C / iOS?
- Autoresizing issue of UICollectionViewCell contentView's frame in Storyboard prototype cell (Xcode 6, iOS 8 SDK) happens when running on iOS 7 only
- How do I access my Application Delegate's window accessor method from another object?
- how to use rounded corner label in iphone,UILabel Round Corners
- How to move to the next page in Facebook JSON response using iOS SDK?
- ios: best way to display variable-length, multi-line text
- How to zoom into a selected area of image in iPhone?
- how to programmatically open the WIFI settings in objective c in iOS9
- How can I programmatically pause an NSTimer?
- What is TIC Read Status 1:57 in iOS11/Xcode 9?
- Exception Breakpoint in Xcode
- UIViewControllerTransitioningDelegate method not called in iOS 7