AFNetworking with cocoapods link error when using Xcode 6 - ios

I got an error when migrating my project from Xcode 5 to 6.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
objc-class-ref in QCRoomListControllerViewController.o
objc-class-ref in libQCBase.a(QCHttpRequestAdapter.o)
objc-class-ref in libQCBase.a(QCHttpApi.o)
"_OBJC_CLASS_$_AFHTTPResponseSerializer", referenced from:
objc-class-ref in QCRoomListControllerViewController.o
"_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
objc-class-ref in libQCBase.a(QCHttpApi.o)
ld: symbol(s) not found for architecture i386
I choose cocoapods as package manager, and the project structure is like below:
both major project and BaseLib are using some pods, at the same time project is using BaseLib.a.
I've try combinations like Xcode 5 with iOS 7.1 SDK(which is the only working one), Xcode 6 with iOS 7.1 SDK and Xcode 6 with iOS 8.0 SDK.
My current conclusion is whenever Xcode 6 is involved, links will fail, no matter which version of iOS SDK I choosed.
Relevant settings are described below.
The xcconfig file are correctly set on both project and BaseLib:
Architectures setting:
My Podfile content:
#platform :ios, "6.0"
source 'https://github.com/CocoaPods/Specs.git'
workspace 'QiChengWS.xcworkspace'
xcodeproj 'QiChengNew/QiChengNew.xcodeproj'
xcodeproj 'QCBase/QCBase.xcodeproj'
target :QiChengNew do
pod 'JSONModel'
pod 'SDWebImage', '~>3.6'
pod 'AutoNSCoding', '~> 0.1.3'
platform :ios, '7.0'
pod 'ProtocolBuffers', '~> 1.9'
pod 'CocoaAsyncSocket', '~> 7.3'
pod 'GBInfiniteScrollView', '~> 1.6'
pod 'GBInfiniteScrollView/PageControl'
pod 'UMengAnalytics', '~> 3.1.2'
platform :ios, '7'
pod 'MWPhotoBrowser', '1.4.0'
xcodeproj 'QiChengNew/QiChengNew.xcodeproj'
end
target :QCBase do
platform :ios, '7.0'
pod "AFNetworking", "~> 2.0"
pod 'SVPullToRefresh', :head
pod 'Toast', '~> 2.3'
xcodeproj 'QCBase/QCBase.xcodeproj'
end

I hope you have found the solution by now. If not updating to AFNetworking 2.4 solved this for me

I have face this type of issue after installing 'pod' file to my project. I resolve this problem by using below code.
[!] The `sftest [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-sftest/Pods-sftest.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Change "Other Linker Flags" to $(inherited) and it solve my problem.

Related

Getting symbol not found for x86_64 in XCode 12 - only Simulator

Getting below error with Xcode 12 while building for Simulator only. Building for real iphone works fine.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AWSTask", referenced from:
objc-class-ref in AWSCognitoUserPoolsSignInProvider.o
"_OBJC_CLASS_$_AWSDDLog", referenced from:
objc-class-ref in AWSUserPoolSignUpViewController.o
objc-class-ref in AWSUserPoolsUIOperations.o
"_OBJC_CLASS_$_AWSServiceConfiguration", referenced from:
objc-class-ref in AWSCognitoUserPoolsSignInProvider.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Below is my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '12.2'
target 'chat' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
#inhibit_all_warnings!
# Pods for chat
pod 'AWSCore', '~> 2.9.10'
pod 'AWSAppSync', '~> 2.10.4'
pod 'AWSMobileClient', '~> 2.9.10'
pod 'AWSAuthUI', '~> 2.9.10'
pod 'AWSUserPoolsSignIn', '~> 2.9.10'
pod 'AWSS3'
pod 'SwiftKeychainWrapper'
pod 'MBProgressHUD'
pod 'Montserrat'
pod 'SDWebImage', '~> 5.0'
pod 'DKImagePickerController'
#, '~> 4.1.4'
pod 'SwipeCellKit'
pod 'GoogleMaps'
pod 'GooglePlaces'
end
Any help please?
I ran into this same issue on a project after upgrading to Xcode 12. What solved it was running pod deintegrate, then pod install.
In our case, we had a project and integrated react native into it. About two weeks later (yesterday) I started running into this situation. So in order to solve it...kinda. What I did is follow this guide troubleshooting guide on react native's website and installed cocoapods-fix-react-native. It is very important to add plugin 'cocoapods-fix-react-native' to your PodFile as per the instructions.
After that I ran pod deintegrate followed by pod install.
So now when I build in Xcode, everything words but if I clean the build folder I have to do a pod deintegrate followed by pod install again.
Sometimes when building, Xcode hangs, just stop and build again.

Error with Card.io using Xcode 8.2 and Swift 2.3

I'm trying to run my project on my device (iPhone 7 Plus: I have already copied my firmware DiskImage to this Xcode folder) with Card.io installed using cocoaPods on Xcode (8.2) with Swift 2.3.
But the compilator shows me this error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CardIOPaymentViewController", referenced from:
type metadata accessor for __ObjC.CardIOPaymentViewController in CheckoutViewController.o
"_OBJC_CLASS_$_CardIOUtilities", referenced from:
type metadata accessor for __ObjC.CardIOUtilities in CheckoutViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Podfile contains:
pod 'PureLayout'
pod 'Fabric', '~> 1.6.8'
pod 'Crashlytics'
pod 'AFNetworking'
pod 'RealmSwift', '~> 0.98.6'
pod 'MBProgressHUD'
pod 'SDWebImage'
pod 'HCSStarRatingView'
pod 'DateTools'
pod 'SWTableViewCell'
pod 'Stripe'
pod 'CardIO'
pod 'SAMTextView'
pod 'IQKeyboardManagerSwift', '4.0.5'
I just typed pod install and launched the .xcworkspace it created.
I tried running this on Simulators but I can't get this to work. Can anyone help me?
I also tried the solution from this post:
CocoaPods error with Card.io.
But $(inherited) already exists in my Other Linker Flags section.
I am unable to figure out why it isn't working on my system. Any help will be appreciated.
Try to use this version
pod 'CardIO', :git => 'https://github.com/card-io/card.io-iOS-SDK.git', :tag => '5.4.1'*
Add the following in a header file
#import <CardIO.h>
not forget adding "CardIO" in Other Linker Flags in Build Settings

Cocoapods Mach-O Linker Errors after adding local dynamic framework

I recently moved my data model objects to their own framework by adding clicking the + button on the project screen. I moved all the files and changed their target memberships to AppCore as opposed to App. The project is purely in Swift.
I updated my podfile to the below:
platform :ios, '10.0'
inhibit_all_warnings!
target 'App' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Crash'
pod 'Firebase/Storage'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
target 'AppCore' do
inherit! :search_paths
end
end
Whenever I try to build I get 4 errors:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRDataSnapshot", referenced from:
objc-class-ref in SSWorkout.o
"_OBJC_CLASS_$_FIRDatabase", referenced from:
objc-class-ref in SSReference.o
objc-class-ref in SSReferrable.o
"_OBJC_CLASS_$_FIRAuth", referenced from:
objc-class-ref in SSUser.o
"_OBJC_CLASS_$_FIRDatabaseReference", referenced from:
objc-class-ref in SSOperation.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have deintegrated and reinstalled pods, cleaned the project, cleaned build folder, deleted derived data etc, I can't get it to compile.
You can reproduce this in the demo project, run pod install and try to build.
https://github.com/Raesu/Demo-Proj
The libraries in Firebase's pod are currently built as static libraries. It is not possible to link static libraries into a dynamic library framework -
DemoCore in your example.
Try enabling bitcode in Xcode build settings and do a clean build, this helps me to resolve the issue
Xcode > Build settings> Enable bitcode

Why does my iOS project with Cocoapods try (and fails) to build on a x86_64 architecture? [duplicate]

This question already has answers here:
ld: framework not found Stripe for architecture x86_64
(4 answers)
iOS , ld: framework not found GoogleMaps for architecture arm64
(3 answers)
Closed 6 years ago.
I got the following error testing my test target in Xcode:
ld: framework not found GoogleMapsBase for architecture x86_64
My project is an iOS project so I don't really understand why it builds with a x86_64 architecture. When examining my Pods project, the build settings feature the following settings:
Base SDK: No SDK (Latest macOS)
Supported Platforms: macOS
Valid architectures: i386 x86_64
My Podfile looks like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Foo' do
use_frameworks!
...
pod 'GooglePlaces', '2.0.1'
...
target 'FooTests' do
inherit! :search_paths
pod 'Quick', '~> 1.0'
pod 'Nimble', '~> 5.0'
end
end
What can I do to fix this issue?
UPDATE: cf this link for the answer of a similar question that helped me fix my issue.
A question. Do you literally included ... in your podfile? Or is it you are omitting other pods with this sign?
Now, the simpler edition of your podfile would be like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Foo' do
use_frameworks!
pod 'GooglePlaces', '2.0.1'
end
target 'FooTests' do
pod 'Quick', '~> 1.0'
pod 'Nimble', '~> 5.0'
end
This should work. Let us know what you got.

CocoaPods error with Card.io

I'm trying to install Card.io (5.2.2) with cocoaPods on Xcode (7.1). But when i run my project the compilator shows me this error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CardIOUtilities", referenced from:
type metadata accessor for __ObjC.CardIOUtilities in CheckoutTableViewController.o
"_OBJC_CLASS_$_CardIOPaymentViewController", referenced from:
type metadata accessor for __ObjC.CardIOPaymentViewController in CheckoutTableViewController.o
ld: symbol(s) not found for architecture arm64
My Podfile contains:
# Uncomment this line to define a global platform for your project
platform :ios, '8.1'
# Uncomment this line if you're using Swift
use_frameworks!
target 'MyApp' do
pod 'Mobile-Buy-SDK'
pod 'HanekeSwift'
pod 'Parse'
pod 'CardIO'
end
i just typed pod install, and launched the .xcworkspace it created.
I think it has something to do with the static libraries inside card.io, but i can't get this to work. Can anyone help me ?
Try adding $(inherited) to your 'Other linker flags' build setting.

Resources