标签:xom 配置 https exce send lib lan tps 微信支付
要接入微信支付的小伙伴,首先要下载一份官方demo(APP微信支付官方Demo下载),然后打开工程,准备大干一场。
编译的时候居然直接报错了(orz)
错误提示:
解决方法:添加CFNetwork.framework
库
选中项目名称 -> 选中TARGETS -> 选中Build Phases -> 在Link Binary With Libraries中添加 -> 点击“+”号,加入CFNetwork.framework
。
修改之后编译成功,接下来就可以运行了,当出来熟悉的微信启动页地球的时候,你可能顿时送了一口气,然而接下来又有一个坑在等着你:
错误提示:
2017-03-17 10:23:39.380 SDKSample[53804:1647093] -[__NSArrayM enqueue:]: unrecognized selector sent to instance 0x61000005a190
2017-03-17 10:23:39.383 SDKSample[53804:1647093] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException‘, reason: ‘-[__NSArrayM enqueue:]: unrecognized selector sent to instance 0x61000005a190‘
*** First throw call stack:
(
0 CoreFoundation 0x000000010d821d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010d1d821e objc_exception_throw + 48
2 CoreFoundation 0x000000010d891f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010d7a7005 ___forwarding___ + 1013
4 CoreFoundation 0x000000010d7a6b88 _CF_forwarding_prep_0 + 120
5 SDKSample 0x000000010a87a51c -[WXOMTASocket send:callback:] + 129
6 SDKSample 0x000000010a87a715 -[WXOMTASocket sendEvent:callback:] + 295
7 SDKSample 0x000000010a85bc6a __reportOneEvent_block_invoke_3 + 252
8 SDKSample 0x000000010a85b8ea __reportOneEvent_block_invoke + 1407
9 libdispatch.dylib 0x000000010e2da978 _dispatch_call_block_and_release + 12
10 libdispatch.dylib 0x000000010e3040cd _dispatch_client_callout + 8
11 libdispatch.dylib 0x000000010e2e1e17 _dispatch_queue_serial_drain + 236
12 libdispatch.dylib 0x000000010e2e2b4b _dispatch_queue_invoke + 1073
13 libdispatch.dylib 0x000000010e2e302b _dispatch_queue_override_invoke + 683
14 libdispatch.dylib 0x000000010e2e5385 _dispatch_root_queue_drain + 720
15 libdispatch.dylib 0x000000010e2e5059 _dispatch_worker_thread3 + 123
16 libsystem_pthread.dylib 0x000000010e6b3712 _pthread_wqthread + 1299
17 libsystem_pthread.dylib 0x000000010e6b31ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
截图如下:
解决方法:
在工程配置中的”Other Linker Flags”中加入”-Objc -all_load”
接下来你就可以愉快的运行 Demo了,但是下面的总结一定要看完。
其实上面的两个错误,在你下载的Demo里面已经有提示了,是因为你没有按照作者的步骤来进行配置:
README.txt
文件路径,因为Demo里面还有个小写的 readme.txt
文档。有时候开发前阅读作者的 README
文档还是很有好处的,可以让你少走许多弯路。
标签:xom 配置 https exce send lib lan tps 微信支付
原文地址:http://www.cnblogs.com/sunfuyou/p/6952575.html