Getting error when adding Segment iOS framework manually

1.9k views Asked by At

I'm trying to add segmentio iOS framework manually in my app. When I build the project, its ended with following error, "Undefined symbols for architecture i386" and logs.

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Amplitude", referenced from:
      objc-class-ref in Analytics(SEGAmplitudeIntegration.o)
  "_OBJC_CLASS_$_AppsFlyerTracker", referenced from:
      objc-class-ref in Analytics(SEGAppsFlyerIntegration.o)
  "_OBJC_CLASS_$_Bugsnag", referenced from:
      objc-class-ref in Analytics(SEGBugsnagIntegration.o)
  "_OBJC_CLASS_$_Countly", referenced from:
      objc-class-ref in Analytics(SEGCountlyIntegration.o)
  "_OBJC_CLASS_$_Crittercism", referenced from:
      objc-class-ref in Analytics(SEGCrittercismIntegration.o)
  "_OBJC_CLASS_$_CrittercismConfig", referenced from:
      objc-class-ref in Analytics(SEGCrittercismIntegration.o)
  "_OBJC_CLASS_$_Flurry", referenced from:
      objc-class-ref in Analytics(SEGFlurryIntegration.o)
  "_OBJC_CLASS_$_GAI", referenced from:
      objc-class-ref in Analytics(SEGGoogleAnalyticsIntegration.o)
  "_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
      objc-class-ref in Analytics(SEGGoogleAnalyticsIntegration.o)
  "_OBJC_CLASS_$_KahunaAnalytics", referenced from:
      objc-class-ref in Analytics(SEGKahunaIntegration.o)
  "_OBJC_CLASS_$_Localytics", referenced from:
      objc-class-ref in Analytics(SEGLocalyticsIntegration.o)
  "_OBJC_CLASS_$_Mixpanel", referenced from:
      objc-class-ref in Analytics(SEGMixpanelIntegration.o)
  "_OBJC_CLASS_$_QuantcastMeasurement", referenced from:
      objc-class-ref in Analytics(SEGQuantcastIntegration.o)
  "_OBJC_CLASS_$_TRVSDictionaryWithCaseInsensitivity", referenced from:
      objc-class-ref in Analytics(SEGAnalyticsIntegration.o)
  "_OBJC_CLASS_$_TSConfig", referenced from:
      objc-class-ref in Analytics(SEGTapstreamIntegration.o)
  "_OBJC_CLASS_$_TSEvent", referenced from:
      objc-class-ref in Analytics(SEGTapstreamIntegration.o)
  "_OBJC_CLASS_$_TSTapstream", referenced from:
      objc-class-ref in Analytics(SEGTapstreamIntegration.o)
  "_kGAIScreenName", referenced from:
      -[SEGGoogleAnalyticsIntegration screen:properties:options:] in Analytics(SEGGoogleAnalyticsIntegration.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How to solve this error, I'm strictly following all instructions given here. However just wont be able to solve it out.

Please help !

4

There are 4 answers

2
Hemang On BEST ANSWER

I used to add Segment framework with Cocoa pods and everything works fine ! But still I'm waiting for an answer which will help to add it manually.

0
nick On

Might be you miss some library or framework. Remove the Analytics.framework once and add again. Make Sure your path is correct in both project and target under Build Setting(Linker path).

1
Artur On

It's means that there needs more frameworks At start there was 21 error, but after adding CoreLocation.Framework there was only 19, so you need to find which frameworks need to be added to your project.

3
rmooney On

I got this to work by adding the following files (and no frameworks) to my project:

Files needed for Segment.IO to work correctly

I also added the line

#import "Analytics.h"

to my bridging header file (since I'm using Swift).

This works for me because I'm not using any integrations client-side (they are being used on the server though).

I got these files by using cocoapods on a separate branch with the podfile line

pod 'Analytics/Segmentio'

Once I did that, I switched back to my main branch (where cocoapods was not being used) and pulled these files in (and none of the CocoaPods configuration files) from the Pods folder.