我正在尝试在Xcode中的cocos2d项目中显示AppLovin sdk,我目前无法调试此Apple Mach-O错误,如下所述。
Undefined symbols for architecture i386:
"_CMTimeGetSeconds", referenced from:
-[ALVideoViewController timeLeft] in libAppLovinSdk.a(ALVideoViewController.o)
-[ALVideoViewController percentViewed] in libAppLovinSdk.a(ALVideoViewController.o)
"_CMTimeMakeWithSeconds", referenced from:
-[ALVideoViewController createCountdownTimeObserver] in libAppLovinSdk.a(ALVideoViewController.o)
"_MPMoviePlayerPlaybackDidFinishNotification", referenced from:
___50-[ALInterstitialViewController prepareForVideoAd:]_block_invoke in libAppLovinSdk.a(ALInterstitialViewController.o)
"_MPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
___53-[ALInterstitialViewController moviePlayerDidFinish:]_block_invoke in libAppLovinSdk.a(ALInterstitialViewController.o)
"_MPMoviePlayerPlaybackStateDidChangeNotification", referenced from:
___50-[ALInterstitialViewController prepareForVideoAd:]_block_invoke in libAppLovinSdk.a(ALInterstitialViewController.o)
"_OBJC_CLASS_$_MPMoviePlayerController", referenced from:
objc-class-ref in libAppLovinSdk.a(ALInterstitialViewController.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我去构建阶段 - >添加其他 - >从显示的finder中选择了libAppLovinSdk.a文件。
我还将Build Active Architectures的值设置为NO,并从架构中删除了arm64。没有i386架构。
答案 0 :(得分:4)
您缺少CoreMedia
和MediaPlayer
框架。
(我通过Google搜索找到了CMTimeGetSeconds
和MPMoviePlayerPlaybackDidFinishNotification
并看到Apple文档的哪些部分得到了点击,但CM
和MP
前缀应该足够了告诉你)。