寄語
在初次導入微信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
解決辦法:在(Build phases -> Link Binary With LiBraries) 中加入庫文件CoreMotion.framework
后續(xù)會不斷更新揪荣,歡迎各位朋友提出問題