因项目要求更新SDK到最新版本,昨天跟新SDK到最新版本之后编译运行项目只有报错
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PayResp", referenced from:
objc-class-ref in PublicPayManager.o
"_OBJC_CLASS_$_PayReq", referenced from:
objc-class-ref in PublicPayManager.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
或者是
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_PayResp", referenced from:
objc-class-ref in PublicPayManager.o
"_OBJC_CLASS_$_PayReq", referenced from:
objc-class-ref in PublicPayManager.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
之后查找了各种方法还是无法解决该问题,在这两种错之间徘徊,最后查找了原因是更新ShareSDK的问题。
因项目本身有微信支付和支付宝支付,自己已经单独集成了一个关于微信APP支付的SDK,而ShareSDK从4.0.4之后更新cocopods的Podfile 文件中的地址
ShareSDK cocopods集成 更换成了:
pod 'mob_sharesdk'
# UI模块(非必须,需要用到ShareSDK提供的分享菜单栏和分享编辑页面需要以下1行)
pod 'mob_sharesdk/ShareSDKUI'
# 平台SDK模块(对照一下平台,需要的加上。如果只需要QQ、微信、新浪微博,只需要以下3行)
pod 'mob_sharesdk/ShareSDKPlatforms/QQ'
pod 'mob_sharesdk/ShareSDKPlatforms/SinaWeibo'
pod 'mob_sharesdk/ShareSDKPlatforms/WeChat' //(微信sdk不带支付的命令)
# pod 'mob_sharesdk/ShareSDKPlatforms/WeChatFull' //(微信sdk带支付的命令,和上面不带支付的不能共存,只能选择一个)
# ShareSDKPlatforms模块其他平台,按需添加
# 如果需要的平台没有对应的平台语句,有2种情况——1、不需要添加这个平台的语句,如Twitter就是这个情况。2、ShareSDK暂时不支持此平台。
pod 'mob_sharesdk/ShareSDKPlatforms/RenRen'
pod 'mob_sharesdk/ShareSDKPlatforms/AliPaySocial'
pod 'mob_sharesdk/ShareSDKPlatforms/Kakao'
pod 'mob_sharesdk/ShareSDKPlatforms/Yixin'
pod 'mob_sharesdk/ShareSDKPlatforms/Facebook'
pod 'mob_sharesdk/ShareSDKPlatforms/Copy'
pod 'mob_sharesdk/ShareSDKPlatforms/Evernote'
pod 'mob_sharesdk/ShareSDKPlatforms/GooglePlus'
pod 'mob_sharesdk/ShareSDKPlatforms/Instagram'
pod 'mob_sharesdk/ShareSDKPlatforms/Instapaper'
pod 'mob_sharesdk/ShareSDKPlatforms/Line'
pod 'mob_sharesdk/ShareSDKPlatforms/Mail'
pod 'mob_sharesdk/ShareSDKPlatforms/SMS'
pod 'mob_sharesdk/ShareSDKPlatforms/WhatsApp'
pod 'mob_sharesdk/ShareSDKPlatforms/MeiPai'
pod 'mob_sharesdk/ShareSDKPlatforms/DingTalk'
pod 'mob_sharesdk/ShareSDKPlatforms/YouTube'
pod 'mob_sharesdk/ShareSDKPlatforms/Twitter'
pod 'mob_sharesdk/ShareSDKPlatforms/Dropbox'
# 使用配置文件分享模块(非必需)
pod 'mob_sharesdk/ShareSDKConfigFile'
# 扩展模块(在调用可以弹出我们UI分享方法的时候是必需的)
pod 'mob_sharesdk/ShareSDKExtension'
关于微信的SDK他给了两个一个是
带有支付的SDK
一个是没有带有支付的SDK
无论集成那个都和自己集成的微信支付的SDK有冲突,造成错误。后来问询了Mob的技术支持才知道要是用他们的微信分享的SDK,就不能再自己集成微信SDK,只能是删除自己集成的微信支付SDK了。
解决办法:更新ShareSDK4.0.4之后版本时,并且本身项目有微信支付;直接导入ShareSDK带有支付的微信SDK,删除自己本身项目集成的SDK。
网友评论