[펌] Unity【iOS】「Undefined symbols for architecture arm64: _OBJC_CLASS_$_GADMediaView」오류
Unity 2020.3.27f1
GoogleMobileAds-v6.1.2
GoogleMobileAds-FacebookUnityAdapter-3.6.0
[에러메시지]
Undefined Symbols for architecture arm64: "_OBJC_CLASS_$_GAD...
[해결방법]
Unity Editor-Menu-External Dependency Manager-iOS Resolver-Settings : Link frameworks statically 체크
[참조] https://newreleases.io/project/github/googleads/googleads-mobile-unity/release/v6.0.0
- [GooglemobileAds 6.0.0] You need to enable "Link frameworks statically" in Unity Editor -> Assets -> External Dependency Manager -> iOS Resolver -> Settings, or else the GMA plugin does not work.
-----------------------------------------------------------------------------------------------------
[펌]
Unity【iOS】「Undefined symbols for architecture arm64: _OBJC_CLASS_$_GADMediaView」エラーの対処法に関するメモ
Unityで開発したアプリをiOSでビルドした際に出たエラーの対処法がわかりづらかったのでメモ。
Xcodeでビルドした際に以下のエラーが出ました。
ld: warning: Could not find or use auto-linked framework 'AVFAudio'
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_GADMediaView", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADRequest", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADNativeAdImageAdLoaderOptions", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADNativeAdViewAdOptions", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADBannerView", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADInterstitialAd", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADNativeAdView", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_kGADAdSizeMediumRectangle", referenced from:
-[ALGoogleMediationAdapter adSizeFromAdFormat:withServerParameters:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADMobileAds", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_kGADAdSizeLeaderboard", referenced from:
-[ALGoogleMediationAdapter adSizeFromAdFormat:withServerParameters:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADAdLoader", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth", referenced from:
-[ALGoogleMediationAdapter adSizeFromAdFormat:withServerParameters:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
+[ALGoogleMediationAdapter currentOrientationAchoredAdaptiveBannerSizeWithWidth:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADQueryInfo", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADExtras", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_kGADAdSizeBanner", referenced from:
-[ALGoogleMediationAdapter adSizeFromAdFormat:withServerParameters:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_OBJC_CLASS_$_GADRewardedAd", referenced from:
objc-class-ref in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
"_kGADAdLoaderAdTypeNative", referenced from:
-[ALGoogleMediationAdapter loadAdViewAdForParameters:adFormat:andNotify:] in AppLovinMediationGoogleAdapter(ALGoogleMediationAdapter.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
このエラーの厄介なところは、具体的にどんな対処をすればいいのかわからない点です。この部分でエラーが出ているよってことがわかればなおせますが、複数の要因により出ていると思われるエラーは修正することで泥沼にいっちゃうこともあるので慎重に対処するのが大事かなと思います。
「Undefined symbols for architecture arm64: _OBJC_CLASS_$_GADMediaView」エラーに関する対処法
僕の環境では以下の方法で解決できました。(具体的なエラー原因がまだわかっていないので、上記のエラーが出た場合の対処法の一つ程度だと思ってもらえれば幸いです)
1.Unityで iOS ResolverのSettingsを開く
2.Link frameworks staticallyにチェックを入れる
3.iOSプロジェクトを出力して再ビルド
上記の方法でエラーが解消されました。
最近結構出るエラーなので、また発生したら今回のメモを参考にしたいと思います。
お知らせ
謎解き推理ゲーム「イラスト探偵」を最近リリースしました!
もしよろしければダウンロードお願い致します!
[출처] https://develop.hateblo.jp/entry/unity-ios-error-build-arm64