Xcode 15 Build Fail,因为AdMob - linker错误

xeufq47z  于 2023-11-21  发布在  其他
关注(0)|答案(1)|浏览(127)

在上传我的游戏到App Store的最后一步,当在Xcode 15中归档项目时,我的构建失败了,因为链接器错误和AdMob未定义符号的原因。可能有一些问题与unity-plugin-library一样,在屏幕截图上。我认为Xcode只是找不到一些文件,从我的项目是与谷歌AdMob广告插件链接。我得到了2个错误和警告

错误如下所示:Unity Framework 2发出未定义的符号:链接器命令失败,退出代码为1(使用-v查看调用)

ld: Undefined symbols:
\_CGSizeFromGADAdSize, referenced from:
\+\[GADUPluginUtil safeAdSizeForAdSize:\] in unity-plugin-library.a\[arm64\] \[14\] (GADUPluginUtil.o) \_GADAdSizeEqualToSize, referenced from:
[enter image description here](https://i.stack.imgur.com/TUZb1.png)
+ \[GADUPluginUtil safeAdSizeForAdSize:\] in unity-plugin-library.a \[arm64\] \[14\] (GADUPluginUtil.o) GADAdSizeFromCGSize, referenced from: \__GAMUBannerViewSetValidAdSizes in unity-plugin-library.a \[arm64\]\[11\] (GADUInterface.o)
+ \[GADUPluginUtil safeAdSizeForAdSize:\] in unity-plugin-library.a \[arm64\] \[14\] (GADUPluginUtil.o) + \[GADUPluginUtil adSizeForWidth: height:\] in unity-plugin-library.a \[arm64\] \[14\] (GADUPluginUtil.o) GADAdSizeFullWidthPortraitWithHeight, referenced from:
+ \[GADUPluginUtil adSizeForWidth: height:\] in unity-plugin-library.a\[arm64\] \[14\] (GADUPluginUtil.o) \_GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth, referenced from:
+ \[GADUPluginUtil adaptiveAdSizeForWidth: orientation:\] in unity-plugin-library.a \[arm64\] \[14\] (GADUPluginUtil.o) GADErrorUserInfoKeyResponseInfo, referenced from:
  GADUGetAdErrorResponse Info in unity-plugin-library.a\[arm64\] \[11\] (GADUInterface.o)
  GADLandscapeAnchored Adaptive BannerAdSizeWithWidth, referenced from:
+ \[GADUPluginUtil adaptiveAdSizeForWidth: orientation:\] in unity-plugin-library.a\[arm64\] \[14\] (GADUPluginUtil.o) GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth, referenced from:
+ \[GADUPluginUtil adaptiveAdSizeForWidth:orientation:\] in unity-plugin-library.a\[arm64\] \[14\] (GADUPluginUtil.o) \_NSValueFromGADAdSize, referenced from:
  \_GAMUBannerViewSetValidAdSizes in unity-plugin-library.a\[arm64\]\[11\] (GADUInterface.o)
  _OBJC_CLASS_$\_GADAppOpenAd, referenced from:
  in unity-plugin-library.a\[arm64\] \[9\] (GADUAppOpenAd.o)
  _OBJC_CLASS_$\__GADBannerView, referenced from:
  in unity-plugin-library.a\[arm64\] \[10\] (GADUBanner.o)
  _OBJC_CLASS_$\_GADExtras, referenced from:
  in unity-plugin-library.a\[arm64\] \[15\] (GADURequest.o) _OBJC_CLASS_$\_GADInterstitialAd, referenced from:
  in unity-plugin-library.a\[arm64\] \[12\] (GADUInterstitial.o)

字符串
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
[错误1](https://i.stack.imgur.com/Z04aV.jpg)[错误2](https://i.stack.imgur.com/JuVmX.png)[错误3](https://i.stack.imgur.com/AZ0l4.jpg)[错误4](https://i.stack.imgur.com/TcBM1.jpg)[错误3](https://i.stack.imgur.com/AZ0l4.jpg)[错误4](https://i.stack.imgur.com/Z04aV.jpg)[错误4](https://i.stack.imgur.com/Z04aV.jpg
我试着在Xcode的Build Phases中的“Compile Sources”窗口中添加库或框架。我试着在“Link binary with Libraries”中添加框架。我试着添加“$inherited”我试着重新启动我的Mac和XCode。起初我是用Google AdMob Unity插件版本8. 4. 0构建的,我更新到了最新的插件8. 5. 2,但错误是一样的
我的配置:Unity:2021.3.31f1 AdMob:8.5.2 Xcode:15 Mac操作系统:Mac操作系统14最新BaseSDK:IOS架构:Arm 64 Ruby:3.2.2 CocoaPods:1.13.0

xdyibdwo

xdyibdwo1#

错误发生是因为没有生成.xcworkspace。我能够通过在youtube上关注这个惊人的视频解决这个问题:https://www.youtube.com/watch?v=CKvsG-_oIBM。之后,你将生成.xcworkspace文件,而不是项目一个将解决错误。

相关问题