導入微信支付報錯解決

寄語

在初次導入微信SDK時很多小伙伴都會遇到各種問題肥败,在這里我記錄一下我遇到的一些問題 整理一下趾浅,歡迎補充愕提!以方便后面的人查看。

常見問題

問題1
Undefined symbols for architecture arm64:
  "_kSecReturnData", referenced from:
      +[WXOMTAKeyChain load:] in libWeChatSDK.a(MTAKeyChain.o)
  "_kSecMatchLimitOne", referenced from:
      +[WXOMTAKeyChain load:] in libWeChatSDK.a(MTAKeyChain.o)
  "_kSecMatchLimit", referenced from:
      +[WXOMTAKeyChain load:] in libWeChatSDK.a(MTAKeyChain.o)
  "_SecItemDelete", referenced from:
      +[WXOMTAKeyChain save:data:] in libWeChatSDK.a(MTAKeyChain.o)
      +[WXOMTAKeyChain delete:] in libWeChatSDK.a(MTAKeyChain.o)
  "_sqlite3_close", referenced from:
      -[WXOMTADataConfigHolder closeDB] in libWeChatSDK.a(MTADataConfigHolder.o)
      -[WXOMTAStore closeDB] in libWeChatSDK.a(MTAStore.o)
  "_SecItemAdd", referenced from:
      +[WXOMTAKeyChain save:data:] in libWeChatSDK.a(MTAKeyChain.o)
  "_kSecClass", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_kSecAttrService", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_kSecAttrAccessibleAfterFirstUnlock", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_inflateInit2_", referenced from:
      +[WXOMTAHelper GUnzip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _unity_z_inflateInit2_)
  "_kSecValueData", referenced from:
      +[WXOMTAKeyChain save:data:] in libWeChatSDK.a(MTAKeyChain.o)
  "_deflateInit2_", referenced from:
      +[WXOMTAHelper GZip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _unity_z_deflateInit2_)
  "_kSecAttrAccount", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_inflate", referenced from:
      +[WXOMTAHelper GUnzip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _inflate_copyright, _unity_z_inflateSyncPoint , _unity_z_inflateGetHeader , _inflate_table , _unity_z_inflatePrime , _unity_z_inflate , _unity_z_inflateInit_ , _unity_z_inflateSetDictionary , _unity_z_inflateReset , __Z27scripting_class_is_inflatedP14ScriptingClass , _il2cpp_class_is_inflated , _inflate_fast , _unity_z_inflateInit2_ , _unity_z_inflateSync , _unity_z_inflateEnd , _unity_z_inflateCopy , _il2cpp_method_is_inflated )
  "_kSecClassGenericPassword", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_sqlite3_reset", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
  "_sqlite3_open", referenced from:
      -[WXOMTADataConfigHolder getDB] in libWeChatSDK.a(MTADataConfigHolder.o)
      -[WXOMTAStore getDB] in libWeChatSDK.a(MTAStore.o)
  "_sqlite3_prepare_v2", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
  "_SecItemCopyMatching", referenced from:
      +[WXOMTAKeyChain load:] in libWeChatSDK.a(MTAKeyChain.o)
  "_sqlite3_bind_text", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
解決辦法:在(Build phases -> Link Binary With LiBraries)  中添加庫文件Security.framework
問題2
"_sqlite3_exec", referenced from:
      -[WXOMTAStore updateDatabase:] in libWeChatSDK.a(MTAStore.o)
      _execute_query in libWeChatSDK.a(MTAStore.o)
      _execute_update in libWeChatSDK.a(MTAStore.o)
  "_kSecAttrAccessible", referenced from:
      +[WXOMTAKeyChain getKeychainQuery:] in libWeChatSDK.a(MTAKeyChain.o)
  "_sqlite3_free", referenced from:
      -[WXOMTAStore updateDatabase:] in libWeChatSDK.a(MTAStore.o)
      _execute_query in libWeChatSDK.a(MTAStore.o)
      _execute_update in libWeChatSDK.a(MTAStore.o)
  "_sqlite3_bind_int64", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
  "_deflateEnd", referenced from:
      +[WXOMTAHelper GZip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _unity_z_deflateEnd)
  "_deflate", referenced from:
      +[WXOMTAHelper GZip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _unity_z_deflateParams, _unity_z_deflateInit_ , _unity_z_deflateInit2_ , _unity_z_deflateReset , _unity_z_deflate_copyright , _unity_z_deflateEnd , _unity_z_deflateSetDictionary , _unity_z_deflate , _unity_z_deflateCopy , _unity_z_deflateBound , _unity_z_deflateSetHeader , _unity_z_deflateTune , _unity_z_deflatePrime )
  "_sqlite3_step", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
  "_inflateEnd", referenced from:
      +[WXOMTAHelper GUnzip:Out:] in libWeChatSDK.a(MTAHelper.o)
     (maybe you meant: _unity_z_inflateEnd)
  "_sqlite3_finalize", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
  "_sqlite3_clear_bindings", referenced from:
      ___36-[WXOMTADataConfigHolder setConfig:]_block_invoke in libWeChatSDK.a(MTADataConfigHolder.o)
      ___27-[WXOMTAStore storeConfig:]_block_invoke in libWeChatSDK.a(MTAStore.o)
      ___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libWeChatSDK.a(MTAStore.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決辦法:在(Build phases -> Link Binary With LiBraries)  中依次加入 libsqlite3.dylib 皿哨,libz.dylib添加后就可以編譯通過

問題3

問題1 .png
解決辦法:在(Build phases -> Link Binary With LiBraries)  中加入庫文件CoreMotion.framework

后續(xù)會不斷更新揪荣,歡迎各位朋友提出問題

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市往史,隨后出現(xiàn)的幾起案子仗颈,更是在濱河造成了極大的恐慌,老刑警劉巖椎例,帶你破解...
    沈念sama閱讀 211,265評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件挨决,死亡現(xiàn)場離奇詭異,居然都是意外死亡订歪,警方通過查閱死者的電腦和手機脖祈,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,078評論 2 385
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來刷晋,“玉大人盖高,你說我怎么就攤上這事⊙凼” “怎么了喻奥?”我有些...
    開封第一講書人閱讀 156,852評論 0 347
  • 文/不壞的土叔 我叫張陵,是天一觀的道長捏悬。 經(jīng)常有香客問我撞蚕,道長,這世上最難降的妖魔是什么过牙? 我笑而不...
    開封第一講書人閱讀 56,408評論 1 283
  • 正文 為了忘掉前任甥厦,我火速辦了婚禮,結果婚禮上寇钉,老公的妹妹穿的比我還像新娘刀疙。我一直安慰自己,他們只是感情好扫倡,可當我...
    茶點故事閱讀 65,445評論 5 384
  • 文/花漫 我一把揭開白布谦秧。 她就那樣靜靜地躺著,像睡著了一般镊辕。 火紅的嫁衣襯著肌膚如雪油够。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,772評論 1 290
  • 那天征懈,我揣著相機與錄音石咬,去河邊找鬼。 笑死卖哎,一個胖子當著我的面吹牛鬼悠,可吹牛的內(nèi)容都是我干的删性。 我是一名探鬼主播,決...
    沈念sama閱讀 38,921評論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼焕窝,長吁一口氣:“原來是場噩夢啊……” “哼蹬挺!你這毒婦竟也來了?” 一聲冷哼從身側響起它掂,我...
    開封第一講書人閱讀 37,688評論 0 266
  • 序言:老撾萬榮一對情侶失蹤巴帮,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后虐秋,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體榕茧,經(jīng)...
    沈念sama閱讀 44,130評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,467評論 2 325
  • 正文 我和宋清朗相戀三年客给,在試婚紗的時候發(fā)現(xiàn)自己被綠了用押。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,617評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡靶剑,死狀恐怖蜻拨,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情桩引,我是刑警寧澤缎讼,帶...
    沈念sama閱讀 34,276評論 4 329
  • 正文 年R本政府宣布,位于F島的核電站阐污,受9級特大地震影響休涤,放射性物質發(fā)生泄漏咱圆。R本人自食惡果不足惜笛辟,卻給世界環(huán)境...
    茶點故事閱讀 39,882評論 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望序苏。 院中可真熱鬧手幢,春花似錦、人聲如沸忱详。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,740評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽匈睁。三九已至监透,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間航唆,已是汗流浹背胀蛮。 一陣腳步聲響...
    開封第一講書人閱讀 31,967評論 1 265
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留糯钙,地道東北人粪狼。 一個月前我還...
    沈念sama閱讀 46,315評論 2 360
  • 正文 我出身青樓退腥,卻偏偏與公主長得像,于是被迫代替她去往敵國和親再榄。 傳聞我的和親對象是個殘疾皇子狡刘,可洞房花燭夜當晚...
    茶點故事閱讀 43,486評論 2 348

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 171,754評論 25 707
  • 發(fā)現(xiàn) 關注 消息 iOS 第三方庫、插件困鸥、知名博客總結 作者大灰狼的小綿羊哥哥關注 2017.06.26 09:4...
    肇東周閱讀 12,059評論 4 62
  • 曾經(jīng)聽過一句話“窮逼就不要談戀愛了” 一開始特別反感這句話疾就。愛情不應該是富人窮人都應該平等享受的情感嗎购城? 后來經(jīng)歷...
    吾聊職場閱讀 4,120評論 0 0
  • 我是從9月28號開始寫手帳的瘪板,到今天有一個多月吧,也是剛剛入門的手帳er漆诽。之前看別人寫的手帳侮攀,特別簡單,也沒什么太...
    阿破的角落邊邊閱讀 3,269評論 20 49
  • 上班了厢拭。 班了兰英。 了。 供鸠。 行了散了吧(并沒有F杳场!楞捂!111 總體來說是因為最近沉迷《驚悚樂園》不能自拔所以看的書都...
    林北落落閱讀 370評論 0 0