Cocoapods Mach-O Linker Errors after adding local dynamic framework - ios

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

Related

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_GADMediatedNativeAdNotificationSource"

I'm having trouble implementing InMobi mediation SDK and adapter into iOS app. Built is resulting with error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GADMediatedNativeAdNotificationSource", referenced from:
objc-class-ref in InMobiAdapter(GADMAdapterInMobi.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm using coocapods as dependency manager. Here is my Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'APP-mobile' do
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMobileAdsMediationInMobi'
pod 'lottie-ios'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
end
target 'APP-desktop' do
end
I manage to solve it by using
pod 'InMobiSDK'
instead of
pod 'GoogleMobileAdsMediationInMobi'
and adding InMobiAdapter into project, download from here.
Complete instruction on InMobi Support Center.

ld: symbol(s) not found for architecture arm64 TwiterKit

For some reason twitterkit is in my project. I did not add it but I guess its part of another pod I have added. The issue im having is that it is giving me 43 errors.
It begins:
Undefined symbols for architecture arm64:
"_TWTRCoreOAuthSigningOAuthEchoHeaders", referenced from:
-[TWTROAuthSigning OAuthEchoHeadersForRequestMethod:URLString:parameters:error:] in TwitterKit(TWTROAuthSigning.o)
"_OBJC_CLASS_$_TWTRScribeService", referenced from:
objc-class-ref in TwitterKit(Twitter.o)
"_TWTRTwitterAuthenticatePath", referenced from:
-[TWTRWebAuthenticationViewController initWithAuthenticationToken:authConfig:APIServiceConfig:forceLogin:] in TwitterKit(TWTRWebAuthenticationViewController.o)
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this?
My pods:
pod 'Firebase'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'FirebaseUI'
pod 'SDWebImage'
pod 'Mapbox-iOS-SDK', '~> 4.9'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Nuke', '~> 7.0'
Before adding Nuke, there was no issue.
Update:
pod 'SDWebImage' Seems to be the pod causing the issue: after remoiving it the errors were gone
What should I do?
Update 2:
After reinstalling SDWebImage the errors are still gone. I do not know what caused the errors.
Looks like the problems with Cocoapods itself and not the specific pod. It happens.
Close Xcode
Execute pod install in terminal
Clean project via Build -> Clean menu item
Build project again
If problem persist update cocoapods and repeat previous process

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 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.

Typhoon build architecture error

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.

Resources