11

I am trying to launch a WebView in iOS and transmit the IDFA as part of a GET request but when I try to build it fails and I get the following error:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
   objc-class-ref in ViewController.o
   ld: symbol(s) not found for architecture i386
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is the code I have. Any idea what I'm doing wrong here, I am a bit stuck

    #import "ViewController.h"
    #import "AdSupport/ASIdentifierManager.h"

    @interface ViewController ()
    @end

    @implementation ViewController
    @synthesize webView;



    - (void)viewDidLoad
    {
        NSString *idfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];

    webView.backgroundColor = [UIColor blueColor];
    NSURL *url = [NSURL URLWithString:@"http://example.com/"];
    NSString *param = [url.path stringByAppendingString: idfaString];
    NSURL *send = [[NSURL alloc] initWithString:param];
    NSURLRequest *req = [NSURLRequest requestWithURL:send];

    [webView loadRequest:req];


    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

    - (void)didReceiveMemoryWarning
   {
       [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

2 Answers 2

32

In case you are as stupid as me, don't forget to add AdSupport.framework in your project too.

2
  • 1
    For me I was trying to build a static library. Which has AdSupport in it. Good to note that you also need AdSupport.framework in the app using the library Dec 22, 2015 at 4:56
  • 1
    i also forget to add the AdSupport.framework in my project Apr 22, 2021 at 10:35
21

Make sure ASIdentifierManager.m is checked under "Target Membership" for your project's target.

1
  • 7
    Thanks @rmaddy. This was in the right direction. I did not have the AdSupport.framework listed under 'Linked Frameworks and Libraries' which can be modified in Xcode under the Tragets --> General section.
    – Cyph
    Dec 4, 2013 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.