エラー内容
iOSでAdmobを使おうとして、Google-Ads ver6.0.0をインポートすると、Xcodeビルド時に以下のエラーが表示される。
Build iOS failed: Undefined symbols for architecture arm64: "_GADURequestInterstitial"
簡単に言うと、arm64向けに_GADURequestInterstitial が定義されていないことが原因であり、インポートしたプラグインに起因する。
arm64とはスマートフォンに搭載されているプロセッサーアーキテクチャのこと。
解決方法
SDKのプラグインを直接いじることはできない(正確にはしたくない)ので、自分でObjective-Cの定義ファイルを作成し、UnityProject内のPluginに格納する必要がある。以下定義ファイルソース。
typedef const void *GADUTypeInterstitialRef;
typedef const void *GADUTypeRewardedAdRef;
typedef const void *GADUTypeRequestRef;
void GADURequestInterstitial(GADUTypeInterstitialRef interstitial, GADUTypeRequestRef request) { }
void GADURequestRewardedAd(GADUTypeRewardedAdRef rewardedAd, GADUTypeRequestRef request) { }
これをAsset>Plugin>iOSに格納すればOK。
参考資料
現在も議論されているフォーラム
Build iOS failed: Undefined symbols for architecture arm64: "_GADURequestInterstitial" #1616