AdMob接入踩坑記

2021-08-17 20:01:24 字數 4689 閱讀 1835

首先列出參考文件:admob官方參考鏈結

我是cocos2d-x v3.9的工程,在按照官方文件接入之後,出現一堆編譯錯誤例如:

[plain]view plain

copy

undefined symbols for architecture arm64:  

"_objc_class_$_glkview", referenced from:  

objc-class-ref in googlemobileads(flat-arm64)  

"_cvopenglestexturecachecreatetexturefromimage", referenced from:  

l2673 in googlemobileads(flat-arm64)  

"_cvopenglestexturegetname", referenced from:  

l2673 in googlemobileads(flat-arm64)  

"_kuttagclassmimetype", referenced from:  

l2987 in googlemobileads(flat-arm64)  

"_cvopenglestexturecachecreate", referenced from:  

l2672 in googlemobileads(flat-arm64)  

"_cvpixelbuffergetheight", referenced from:  

l2670 in googlemobileads(flat-arm64)  

"_cvopenglestexturecacheflush", referenced from:  

l2671 in googlemobileads(flat-arm64)  

"_cvbuffergetattachment", referenced from:  

l2670 in googlemobileads(flat-arm64)  

"_uttypecreatepreferredidentifierfortag", referenced from:  

l2987 in googlemobileads(flat-arm64)  

"_cvpixelbuffergetwidth", referenced from:  

l2670 in googlemobileads(flat-arm64)  

"_kcvimagebufferycbcrmatrixkey", referenced from:  

l2670 in googlemobileads(flat-arm64)  

"_cvopenglestexturegettarget", referenced from:  

l2673 in googlemobileads(flat-arm64)  

"_kcvpixelbufferpixelformattypekey", referenced from:  

l090 in googlemobileads(flat-arm64)  

"_kcvimagebufferycbcrmatrix_itu_r_601_4", referenced from:  

l2670 in googlemobileads(flat-arm64)  

"_glkmatrix4identity", referenced from:  

l2664 in googlemobileads(flat-arm64)  

l2675 in googlemobileads(flat-arm64)  

ld: symbol(s) not found for architecture arm64  

clang: error: linker command failed with exit code 1 (use -v to see invocation)  

請參見這篇文章的對照表,加入相應的系統框架:參考文章

framework名

缺少框架會報的錯

glkit.framework

_objc_class_$_glkview

_glkmatrix4identity

mobilecoreservices.framework

_kuttagclassmimetype

_uttypecreatepreferredidentifierfortag

corevideo.framework

_cvopenglestexturecachecreatetexturefromimage

_cvopenglestexturegetname

_cvopenglestexturecachecreate

_cvopenglestexturecacheflush

_cvpixelbuffergetwidth

_cvopenglestexturegettarget

_kcvpixelbufferpixelformattypekey

_kcvimagebufferycbcrmatrix_itu_r_601_4

_cvpixelbuffergetheight

_cvbuffergetattachment

_kcvimagebufferycbcrmatrixkey

storekit.framework

_objc_class_$_skproductsrequest

_objc_class_$_skmutablepayment

_objc_class_$_skpaymentqueue

_objc_class_$_skstoreproductviewcontroller

_skstoreproductparameteritunesitemidentifier

mediaplayer.framework

_mpmovieplayerplaybackdidfinishnotification

_mpmovieplayerplaybackstatedidchangenotification

_objc_class_$_mpmovieplayercontroller

_objc_class_$_mpvolumeview

safariservices.framework

_objc_class_$_sfsafariviewcontroller

adsupport.framework

_objc_class_$_asidentifiermanager

coremotion.framework

_objc_class_$_cmmotionmanager

coretelephony.framework

_ctradioaccesstechnologydidchangenotification

_objc_class_$_cttelephonynetworkinfo

messageui.framework

_objc_class_$_mfmailcomposeviewcontroller

_objc_class_$_mfmessagecomposeviewcontroller

coretext.framework

_ctframesettercreatewithattributedstring

_ctframesettersuggestframesizewithconstraints

gamekit.framework

_objc_class_$_gkachievement

_objc_class_$_gkscore

_objc_class_$_gkgamecenterviewcontroller

_objc_class_$_gklocalplayer

systemconfiguration.framework

_scnetworkreachabilitycreatewithaddress

_scnetworkreachabilitygetflags

_scnetworkreachabilitycreatewithname

_scnetworkreachabilitysetdispatchqueue

_scnetworkreachabilitysetcallback

security.framework

_seccertificatecreatewithdata

_sectrustcopyexceptions

_sectrustevaluate

_sectrustsetanchorcertificates

_sectrustsetexceptions

coremedia.framework

_cmtimegetseconds

_cmtimemakewithseconds

_cmtimemake

_kcmtimezero

opengles.framework

_objc_class_$_eaglcontext

_glactivetexture

cfnetwork.framework

_cfhostcreatewithname

_cfhoststartinforesolution

_cfhostgetaddressing

一般國外的sdk文件都乙個尿性,文件及其簡單。

在接入admob插屏廣告的時候,我就遇到上面的一類問題,然後就ok了

admob 接入問題

admob的ios接入文件說得極其簡單,只需要加入admob的framework就好了,但一編譯就是一堆錯誤,需要連線一大堆系統framework,還好別人整理了出來,備查。首先列出參考文件 admob官方參考鏈結 我是cocos2d x v3.9的工程,在按照官方文件接入之後,出現一堆編譯錯誤例如...

接入SDK踩坑總結

昨天終於提審了第乙個版本,總結一下接入的sdk的坑吧。專案中暫時接入的第三方sdk有facebook,firebase,google admob。雖然接入的不多,但是坑多。第乙個facebook,要密切關注官網更新版本所支援的xcode版本。比如 這裡從v7.13.0公升級到v7.14.0就會有很大...

mybatis LocalCache踩坑記錄

上週週三下午,準備去吃飯的時候,值班突然找過來說使用者操作時爆出訂單不存在的問題,因為之前做了分表連續很長一段時間都沒問題,而且當時找過來的都是一些因為產品或者qa操作不當找不到記錄的情況,就沒有在意這些,當時以為幾分鐘就能搞定,但是沒想到居然是線上日誌爆出的問題,經過驗證訂單確實不存在!心想完了,...