寄语
在初次导入微信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
后续会不断更新,欢迎各位朋友提出问题