Search Unity

Build error with "Undefined symbols for architecture arm64: _OBJC_CLASS_$_AVPlayerViewController"

Discussion in 'iOS and tvOS' started by kencoderhk, Dec 11, 2018.

  1. kencoderhk

    kencoderhk

    Joined:
    Dec 11, 2018
    Posts:
    9
    Dear all,

    I am making a iOS Plugin that try to play a video using "AVPlayerViewController";

    I already add the AVFoundation Framework, but the error still appear.

    Do anyone know how to fix it??

    this is the source code:

    Code (ObjectiveC):
    1.  
    2. + (void)showVideo:(NSURL *)videoURL callerVC:(UIViewController *)callerVC
    3. {
    4.    
    5.     AVPlayer *player = [AVPlayer playerWithURL:videoURL];
    6.    
    7.     AVPlayerViewController *vc = [[AVPlayerViewController alloc] init];
    8.    
    9.     vc.player = player;
    10.    
    11.     [callerVC presentViewController:vc animated:YES completion:^{
    12.         [vc.player play];
    13.     }];
    14. }
    Error Detail:

     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    did you add the relevant #import statements at the top of your objective-c file ?
     
  3. raviIOS

    raviIOS

    Joined:
    Mar 27, 2019
    Posts:
    13
    Step1: Visit Build phases
    Step2: Add AVKit.framework
    Chears.
     
  4. kencoderhk

    kencoderhk

    Joined:
    Dec 11, 2018
    Posts:
    9
    Thanks !!
     
  5. ExtremeKaos

    ExtremeKaos

    Joined:
    Dec 4, 2016
    Posts:
    7
    Thanks , thanks , thanks,,,, ravIOS i owe you a beer..... AVKit.framework. I migrate a Unity 5.X to Unity 2019 with a existing app and this save my live :)
     
  6. shielafurio

    shielafurio

    Joined:
    Jan 21, 2019
    Posts:
    1
    Hi, Im new with react native also with xcode. Can you please make your solution with step by step. I dont really know where to find build phase and where to get that AVKit.framework. Thank you!!