IOS Undefined symbols for architecture x86_64 - ios

I tried to put AFNetworking 2.0 framework by usual drag and drop in iOS. Then when I execute the application it says the below errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
objc-class-ref in TableViewController.o "_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
objc-class-ref in TableViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
Please let me know how to resolve this issue.
I tried to use cocoapods but for some reason I couldn't install cocoapods in my machine.

I spent a couple of hours fighting with this exact same issue, going through all the Google hits I could find. Building for the device was working, but building for the simulator was not.
Here are the steps that finally solved the issue for me:
Clear the XCode caches:
rm -rf ~/Library/Developer/Xcode/DerivedData/
Clear the CocoaPods caches and reinstall the dependencies:
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
Finally go to the "Pods" project and set the Build Active Architectures Only to No also for the "Debug" configuration.

I used xCode 6.1.1, download and add to project updated AFNetworking and had the same problem, but with old version AFNetworking worked good.
Check this two ways, worked for me:
1) update xCode
2) download old version AFNetworking

This kind of weird stuff started to happen after Xcode 11.4.1 update. Any library, framework that you previously had, and didn't have the symbols to be compiled to iOS simulator(x86_64) can show these errors...
One solution is to recompile the framework in your machine adding the all architectures needed. I haven't recompiled AFNetworking lately, so I cannot give you a step by step on that... But probably in AFNetworking repo, they should have a makefile or configure script to that kind of thing.
Good luck!

Related

Undefined symbols for architecture armv7 - linker command failed

I am working on a game developed with unity, when i try to build it for iOS i got build failed due to undefined symbol.
"_OBJC_CLASS_$_LAContext", referenced from:
objc-class-ref in GoogleSignIn(MDMPasscodeCache_7bfe55864ba5a0ab8141ccdcdc4ab596.o)
"__SuperpowPlugin_ShowCustomerReview", referenced from:
_SuperpowIOS__SuperpowPlugin_ShowCustomerReview_m3277441088 in Bulk_Assembly-CSharp-firstpass_2.o
_SuperpowIOS_ShowCustomerReview_m2157481586 in Bulk_Assembly-CSharp-firstpass_2.o
(maybe you meant: _SuperpowIOS__SuperpowPlugin_ShowCustomerReview_m3277441088)
"__SuperpowPlugin_SetNotifyAppearance", referenced from:
_SuperpowIOS__SuperpowPlugin_SetNotifyAppearance_m2340220546 in Bulk_Assembly-CSharp-firstpass_2.o
(maybe you meant: _SuperpowIOS__SuperpowPlugin_SetNotifyAppearance_m2340220546)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My xcode version is 9.4 and unity 5.6.1f1.
I have been stuck with this since 3 days, have searched a lot and linked missing files and frameworks, solved many errors but this is the one i can't get rid of.
Any help would be great.
Thanks
Try this following steps -
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
After doing some research, I finally figured it out. I have Gooogle mobile ads plugin and google play game plugins both. I didn't installed cocoa pods and I was adding all frameworks in Xcode.
Installing cocoa pods did the job :)
sudo gem install cocoapods
After that i rebuild the xcode project from unity and add all frameworks and files mentioned in particular plugin installation and it worked.
So anyone having same issue, then please check for your pod installation.

React Native and RNFirebase iOS Release Builds Failing

I'm using Firebase via RNFirebase in React Native. I've gone through the steps here: https://rnfirebase.io/docs/v5.x.x/installation/ios.
Debug builds in the Simulator and to my device work just fine, but when I attempt to archive a Release build it fails with this error.
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/nanopb'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Also in the build logs I can see that the Debug config builds those targets, but they are not in the output for Release config builds. I get the feeling it has to do with building for all architectures, but don't know how where to start solving that. I just feel like I am poking around without a real strategy to solve it. Any ideas?
Some things I have tried...
Using the Legacy Build System
Removing node_modules and rerunning npm install
Removing / adding the related pods
Deintegerating and readding Cocoapods
Clearing DerivedData
Restarting my computer
I've seen this happen when switching use_frameworks! off and on.
The solution was deleting FirebaseAuth and other libraries from the Build Setting - Other Linker Flags(OTHER_LDFLAGS)
I got help from this PR: https://github.com/invertase/react-native-firebase-starter/pull/61
It was a combo of dropping down to the Legacy Build System in Xcode 10 and upgrading React Native to 0.57.2.

iOS build succeeds but fails to archive

I have been working on my first ResearchKit app. Since the last time I created an archive, I have included a custom library for creating JSON strings. See my previous question.
After importing the .h file in that bridging-header file, I was able to use the package.
The project was running fine in the simulator. I even did a fresh clean and build for the "Generic iOS Device", and that completed with no errors. When I went to archive the project, during the linking stage, I get this error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_ORKLocation", referenced from:
objc-class-ref in ORKESerialization.o "_OBJC_CLASS_$_ORKConfirmTextAnswerFormat", referenced from:
objc-class-ref in ORKESerialization.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit
code 1 (use -v to see invocation)
My Xcode version is 7.1.1. I have been searching around the web for possible answers. Apparently it might have something to do with these architecture version, but I can't seen to pinpoint the problem. Any help would be appreciated. Thanks!
This sounds like a bug. Best bet is to file it on Github.

Xcode - Missing Architecture (library linking)

For the recent couple of days I have had this compiler error in Xcode every time I've built my project:
ld: warning: ignoring file /.../(Framework Name).framework/(Framework), missing required architecture x86_64 in file /.../(Framework Name).framework/(Framework) (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CLSNAME", referenced from:
objc-class-ref in ViewController.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 also can't run this code on the iPhone 5 simulator (i386).
The iPhone device I have is outdated and can't run iOS 8. I tried setting the build settings to iOS 7 but I get an error regarding the lack of support for dynamic libraries before iOS 8.
Things to note:
I am using 2 projects, in 2 different workspaces. (one for the library and one for the demo app. Tests of the same code with the unit tests in the library project are successful.)
I used to be able to link the demo project with the library project until I had to do some changes in the library code. After I exported the newer version this error started occurring.
In order to get the library file/folder (.framework) I used the Archive option.
Running lipo -info outputs Architectures in the fat file: lib.a armv7 arm64
I have C++ code in the library project (unlikely to be the issue)
In the library project, I am using another external library I installed with Cocoa Pods (also used to work before changes in the library code)
Solutions I tried:
Changing the Architectures and the Valid Architectures list in Build Settings.
Setting "Build Active Architecture Only" to "No" in Build Settings.
Creating a new project (both for the demo and the library)
Making the library a static library (new project, got the same warning, no error, couldn't #import the files I needed)
I only started working with iOS and Xcode a couple of months ago and I am not super-experienced with everything there yet, so please try to explain everything with as much detail as you can.
Thanks in advance to anyone trying to help :)
Did you add the framework it says is missing? Also, try to delete the Derived Data folder and then clean the project. If that does not work, then turn off Modules in build settings.

Venmo touch Braintree payment - compile error: Undefined symbols for architecture i386: "_OBJC_CLASS_$_VTClient"

I have successfully installed braintree ios sdk using cocoapod and It was compiled fine.
However, when I initVTClient in my appdelegate.m file. I was getting compiling error:
Undefined symbols for architecture i386:
"OBJCCLASS_$_VTClient", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and I couldn't find any solutions online at all. any tips?
also submitted an issue here:
https://github.com/braintree/braintree_ios/issues/27
It's possible that you need to put "build settings"->architectures back to "standard architectures" since the old Venmo library (before their big v0 update) was built before the 64bit architecture. That's one solution I've seen.
[EDITED: 2/25/2014, 4:47pm EST]
I got my project to work. The problem for me was that my existing build settings were getting in the way of the build settings that cocoapods wanted to load onto the project. Those are the important ones such as the Venmo Framework, so there's good reason for the issue.
If you go to "build settings" -> "other linker flags", and add a new flag: "$(inherited)", it will work. I put that one at the top of the list so I'd try the same, not sure if order matters. What this does is keeps your old settings / flags, (I was using -ObjC), and imports the new ones from cocoapods. Good luck.
looks like i need to add VenmoTouch.framework into my target->Link Binary with Libraries.
then what's the point of using cocoapods
the official answer:
https://github.com/braintree/braintree_ios/issues/27
Make sure you verify which target CocoaPods is integrating with. There are a number of patterns for specifying this, such as target "name" do ... end and link_with.
See here for more details: http://guides.cocoapods.org/syntax/podfile.html#link_with

Resources