Typhoon build architecture error - ios

Error :
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_TyphoonAssembly", referenced from:
_OBJC_CLASS_$_AppAssembly in AppAssembly.o
"_OBJC_CLASS_$_TyphoonBlockComponentFactory", referenced from:
objc-class-ref in AppAssembly.o
"_OBJC_CLASS_$_TyphoonComponentFactory", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in UIViewController+PropertyInjector.o
objc-class-ref in ReminderViewController.o
objc-class-ref in AppAssembly+AddReminder.o
objc-class-ref in DashboardViewController.o
objc-class-ref in AppAssembly+Dashboard.o
"_OBJC_CLASS_$_TyphoonDefinition", referenced from:
objc-class-ref in AppAssembly.o
objc-class-ref in AppAssembly+ViewControllers.o
objc-class-ref in AppAssembly+Actions.o
...
"_OBJC_METACLASS_$_TyphoonAssembly", referenced from:
_OBJC_METACLASS_$_AppAssembly in AppAssembly.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What are the build configurations, architecture. I am using
cocoa pods, XCode 7.1, target iOS version is 8.4. How can I solve this build error?
Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
xcodeproj 'Proj'
pod 'KGModal'
pod 'JSONKit'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'TTTAttributedLabel'
target :Proj, :exclusive => true do
# pod 'Typhoon', :head
end
target :ProjTest, :exclusive => true do
pod 'Kiwi'
end
Podfile install output
Update all pods
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using Typhoon (3.4.1)
Using Bolts (1.4.0)
Using FBSDKCoreKit (4.7.1)
Using FBSDKLoginKit (4.7.1)
Using FBSDKShareKit (4.7.1)
Using JRSwizzle (1.0)
Using JSONKit (1.4)
Using KGModal (1.2.0)
Using Kiwi (2.4.0)
Using TTTAttributedLabel (1.13.4)
Generating Pods project
Integrating client project
Sending stats
Sending stats
Pod installation complete! There are 8 dependencies from the Podfile and 9
total pods installed.
This is pod update output, There is no other errors in terminal and I added $(inherited) to linker search path

It is a basic error because your Xcode is unable to search for library you want through pod. Try the following steps before installing cocoapods:
clean your project
remove all the libraries you want to include via Cocoapods.
Add $inherited in your Linker Search Path in Build Settings.
Follow all steps of cocoapods installation as given on Cococapods.org.
check for any errors which might come in terminal.
If any error rectify them , and agin install podfile
after installing podfile clean your project again (cmd + shift + k).
Also lastly if you have done all these steps and still showing this error. check whether the libraries you are importing is getting imported via pods or manual. change them to
#import <AFNetworking/AFNetworking.h> kind.
If still getting error post a comment.

Related

Using FirebaseAnalytics in a cocoapod resulting in error during compilation

I am using FirebaseAnalytics in a cocoa development pod, and facing an error during compilation, saying
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRAnalytics", referenced from:
objc-class-ref in FirebaseService.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My pod file is like
pod 'Firebase/Crashlytics', :inhibit_warnings => true
pod 'Firebase/Analytics', :inhibit_warnings => true
and the podsec in the pod is like
spec.dependency 'Firebase/Crashlytics'
spec.dependency 'Firebase/Analytics'
It so only happens when I use any Analytics.* in my code in the development pod. If I move the logic to the AppDelegate (the main app project), there is no error.
I have tried cleaning up the Framework Search PATHs from both app and the development pod, as suggested in https://github.com/firebase/firebase-ios-sdk/issues/7614#issuecomment-786827116, but still no luck.
Any ideas?

Compile error for XCUITest for googleSignIn

I have configured GoogleSignIn using pod.
My pod file
target ‘MyApp’ do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'p2.OAuth2'
pod 'GoogleSignIn'
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
pod 'p2.OAuth2'
pod 'GoogleSignIn'
end
end
I am able to Sign In to google.
For XCUITest, I am getting error
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GIDSignIn", referenced from:
objc-class-ref in Myclass.o
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In those classes I have imported "GoogleSignIn".
How do I solve this issue?
Bitcode is off, other liner flags -ObjC is added.
I have checked build setting for test target.
test target-> build setting -> other linker flags
I have added "-framework" and next to it "GoogleSignIn". It worked.

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

Undefined symbols for architecture x86_64 AFNetworking with Cocoapods

Can anybody help me with this, its driving me crazy. I looked at every post I could find with a similar issue, and none of it worked.
I installed AFNetworking 3.0 in my project with Cocoapods, it installed, I see the AFNetworking pod in my project.Set built Architure only :YES Whenever I try to build I get the following error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
objc-class-ref in EFServer.o
"_OBJC_CLASS_$_MBProgressHUD", referenced from:
objc-class-ref in EFServer.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 had the same problem after installing pods to my old project. In my case there where custom linker flags added to the Build Settings of the target, but the $(inherited) was removed so the pods flags were missing (not inherited) therefore no AFNetworking framework were linked.
I suggest to check out is there a $(inherited) row added to the Other Linker Flags section of Build Settings for the target.
Just delete the DerivedData folder and re-try.
rm -rf ~/Library/Developer/Xcode/DerivedData
add below lines to your podfile and reinstall it and add your project name to target.
target 'your project name' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end
hope your problem will be solved.

Link errors installing Google Analytics via CocoaPods 0.36.0 using dynamic frameworks

I am trying to update my project to use CocoaPods 0.36.0's new use_frameworks! option. I am using Objective-C (not Swift) in Xcode 6.2 and the deployment target is 8.1.
Everything is building and linking correctly except for Google Analytics, for which I get linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in NPDAnalytics.o
"_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
objc-class-ref in NPDAnalytics.o
ld: symbol(s) not found for architecture x86_64
I have tried changing my old-style
#import <GoogleAnalytics_iOS_SDK/GAI.h>
to a module import:
#import GoogleAnalytics_iOS_SDK;
But that didn't help anything.
Is GAI just incompatible with CocoaPods' implementation of dynamic frameworks or is there some other trick to getting it to work?
I've successfully added this dependency by adding the platform limit with this instruction in the podspec of your private library to limit to iOS devices only :
Pod::Spec.new do |m|
...
m.platform = :ios, "7.0"

Resources