简体   繁体   中英

How do I get my build to succeed in xcode after I include Flurry analytics?

I've included the folder labeled 'Flurry' in my project. I've added the lines in AppDelegate.m:

#import "Flurry.h"

- (void)applicationDidFinishLaunching:(UIApplication *)application
{
    [Flurry startSession:@"my_key"];
}

However, I get 7 errors after I try to run.

Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[FlurryReachability flurryReachabilityWithAddress:] in libFlurry.a(libFlurry.a-i386-master.o)
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[FlurryReachability flurryReachabilityWithHostName:] in libFlurry.a(libFlurry.a-i386-master.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[FlurryReachability flurryCurrentReachabilityStatus] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryReachable] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryConnectionRequired] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryConnectionOnDemand] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryUserInterventionRequired] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryReachableViaWWAN] in libFlurry.a(libFlurry.a-i386-master.o)
      -[FlurryReachability isFlurryReachableViaWiFi] in libFlurry.a(libFlurry.a-i386-master.o)
      ...
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[FlurryReachability flurryStartNotifier] in libFlurry.a(libFlurry.a-i386-master.o)
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[FlurryReachability flurryStartNotifier] in libFlurry.a(libFlurry.a-i386-master.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[FlurryReachability flurryStopNotifier] in libFlurry.a(libFlurry.a-i386-master.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

You're getting these errors because Flurry.h/.a reference the framework SystemConfiguration.framework , and you haven't added it to your project.

To add it to your project, select your project in Xcode (very top in the navigation thing on the left), and select your target. Scroll down to the heading 'Linked Frameworks and Libraries'. There will be a list of items with little toolboxes next to them. Click the plus button at the bottom of that list.

In the resulting popover thing, search for 'SystemConfiguration'. Double click on it.

Repeat for Each Target

Run your project. Get build succeeded. Done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM