3

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 !

Hemang
  • 26,840
  • 19
  • 119
  • 186
  • For anyone reading, it looks like you can now use **Carthage** - which is incredibly better than cocoapods. (It simply "makes the files for you" - and you take care of adding them to your project yourself, just as the OP asks.) – Fattie Nov 09 '16 at 20:08

4 Answers4

1

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.

Hemang
  • 26,840
  • 19
  • 119
  • 186
  • Did you ever get a response on how to add it manually? I'm running into the same issue. – rmooney Jul 17 '15 at 16:55
  • @rmooney, No not yet, but you can keep looking [here](https://github.com/segmentio/analytics-ios/issues/331). The same question asked to Segment Developers on Github. – Hemang Jul 18 '15 at 04:12
1

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.

Artur
  • 11
  • 2
1

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.

rmooney
  • 6,123
  • 3
  • 29
  • 29
  • thanks for this info. Cocoapods is such a nuisance. Why doesn't segmentio just have a zipfile download, for goodness sake. – Fattie Nov 09 '16 at 19:51
  • 1
    Because that would be too easy. :) – rmooney Nov 09 '16 at 19:58
  • @mooney - no kidding, thanks again. I found I could use "Carthage" which is a billion times better and easier than cocoapods. Cheers again. – Fattie Nov 09 '16 at 20:07
0

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

nick
  • 114
  • 1
  • 4