Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS _OBJC_CLASS_$_ASIdentifierManage referenced from: objc-class-ref in ViewController.o

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
like image 420
Cyph Avatar asked Dec 03 '13 23:12

Cyph


2 Answers

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

like image 180
Enrico Susatyo Avatar answered Nov 09 '22 19:11

Enrico Susatyo


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

like image 21
rmaddy Avatar answered Nov 09 '22 20:11

rmaddy