iVanPan / Cordova_QQ

A Cordova wrapper around the Tencent QQ SDK for Android and iOS. Provides access to QQ ssoLogin, QQ Sharing, QQZone Sharing etc.
MIT License
287 stars 133 forks source link

安装插件后,cordova build ios出错 #40

Closed owen26 closed 8 years ago

owen26 commented 8 years ago

第一次使用这个插件,之前用过你写的微博插件,以及其他人的微信分享插件,都没有碰到build问题。

cordova版本最新的6.2.0, qq插件版本最新,xcode版本7.1.3

执行cordova build ios时,最后报错信息为:

The following build commands failed: Ld build/emulator/BX2.app/BX2 normal i386 (1 failure) Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/xinan/Projects/JRKB/JRKB.Mobile/platforms/ios/cordova/build-release.xcconfig,-project,BX2.xcodeproj,ARCHS=i386,-target,BX2,-configuration,Release,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/xinan/Projects/JRKB/JRKB.Mobile/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/xinan/Projects/JRKB/JRKB.Mobile/platforms/ios/build/sharedpch

再往上翻log,发现是qq插件出错引起的,卸载插件后编译正常,和插件相关的报错信息为:

Ld build/emulator/BX2.app/BX2 normal i386 cd /Users/xinan/Projects/JRKB/JRKB.Mobile/platforms/ios export IPHONEOS_DEPLOYMENT_TARGET=8.0 ld: warning: ignoring file BX2/Plugins/cordova-plugin-qqsdk/TencentOpenAPI.framework/TencentOpenAPI, missing required architecture i386 in file BX2/Plugins/cordova-plugin-qqsdk/TencentOpenAPI.framework/TencentOpenAPI (3 slices) Undefined symbols for architecture i386: "_OBJCCLASS$_QQApiInterface", referenced from: objc-class-ref in YCQQ.o "_OBJCCLASS$_QQApiNewsObject", referenced from: objc-class-ref in YCQQ.o "_OBJCCLASS$_SendMessageToQQReq", referenced from: objc-class-ref in YCQQ.o "_OBJCCLASS$_TencentOAuth", referenced from: objc-class-ref in YCQQ.o "_kOPEN_PERMISSION_ADD_ALBUM", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_ADD_ONE_BLOG", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_ADD_SHARE", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_ADD_TOPIC", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_CHECK_PAGE_FANS", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_OTHER_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_SIMPLE_USER_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_USER_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_VIP_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_GET_VIP_RICH_INFO", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_LIST_ALBUM", referenced from: -[YCQQ qqLogin:] in YCQQ.o "_kOPEN_PERMISSION_UPLOAD_PIC", referenced from: -[YCQQ qqLogin:] in YCQQ.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

iVanPan commented 8 years ago

@owen26 使用 cordova build --device 命令来编译 最新的QQ SDK 官方不再支持i386的架构了

owen26 commented 8 years ago

谢谢,回复真效率!

已经可以正常跑起来了,但是有个问题,分享qq和空间的时候都是执行分享操作的瞬间即弹出alert("share success"), 在跳转到qq应用之前就弹出来,而不是分享成功后才执行的回调函数。

我不知道这个是我自己的配置问题,还是确实有bug。

代码直接拷贝demo,没修改。

iVanPan commented 8 years ago

@owen26 这个不是你的问题,分享是异步执行的,这个问题在iOS会有,会在后续版本里面去想办法修复,目前iOS我只是参照官方的Demo做了一个wrapper而已

owen26 commented 8 years ago

@iVanPan 好的知道了,谢谢。

huhaixiang commented 8 years ago

根据上面的方法 ,仍然不能编译iOS,,报相同的错误

junhui75165 commented 8 years ago

用cordova build --device的确可以编译ios通过,并生成了ipa,但是并不能启动qq,这个能解释一下吗

iVanPan commented 8 years ago

@junhui75165 没有明白你的意思?是指使用QQ登陆功能不能唤起QQ手机客户端吗?

junhui75165 commented 8 years ago

@iVanPan 的确,ios打包的不能唤起qq客户端,ios的微信是正常的,安卓平台的都没有问题

junhui75165 commented 8 years ago

@iVanPan build ios报了i386的错误,看这里时候使用cordova build --device可以,但是并没唤醒qq客户端,我查了一下URL Types跟开放平台的一样,我想应该不是这里配置出错了

iVanPan commented 8 years ago

@junhui75165 我刚刚做了测试没有发现问题哎,能否提供一些额外的信息给我,还有真机上面调试可以唤醒吗?

junhui75165 commented 8 years ago

@iVanPan 现在是打包的真机来测试的,有没有可能是今天更改的这个URL Types 并没有生效,我这里只是编译通过后打包测试,也没有其他的错误信息。cordova build --devic打包的不能启动客户端,直接闪退,我是用xcode打包出来的

iVanPan commented 8 years ago

@junhui75165 我的意思是真机连接Xcode 运行 行不行,可以在Xcode里面查看Log

junhui75165 commented 8 years ago

@iVanPan 真机测试下点击qq后打出的log如下,不知道这个是什么情况 2016-09-20:14:49:47:650 -QQAPI- ConfigManager.m:117 @@ 2016-09-20 14:49:47.671 *[1744:1053331] THREAD WARNING: ['YCQQ'] took '17.333008' ms. Plugin should use a background thread. 2016-09-20 14:49:47.674 [1744:1053331] -[NSNull integerValue]: unrecognized selector sent to instance 0x19f8ca490 2016-09-20 14:49:47.676 *[1744:1053331] _\ WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: -[NSNull integerValue]: unrecognized selector sent to instance 0x19f8ca490

iVanPan commented 8 years ago

@junhui75165 是有个方法没有找到,你删除插件 重新安装一个新本的版本试试看,看一下我提供的demo能不能跑通

junhui75165 commented 8 years ago

@iVanPan 重装一下插件,试了一下结果差不多 重装的时候会提示这个错误,运行不了,我删掉客户端重装才可以,但是提示的错误是一样的,我这里只用了qq客户端检查的这个方法,没使用其他的 2016-09-20 15:38:41.493 *[1773:1062929] Received memory warning. 2016-09-20 15:38:41.496 [1773:1062929] Received memory warning. 2016-09-20 15:38:41.499 *[1773:1062929] Received memory warning. 2016-09-20 15:38:41.611 **[1773:1062929] Received memory warning. Message from debugger: Terminated due to memory issue

运行xcode提示错误基本没变 2016-09-20:15:42:34:192 -QQAPI- ConfigManager.m:117 @@ 2016-09-20 15:42:34.208 *[1780:1064272] THREAD WARNING: ['YCQQ'] took '13.894043' ms. Plugin should use a background thread. 2016-09-20 15:42:34.218 [1780:1064272] -[NSNull integerValue]: unrecognized selector sent to instance 0x19f8ca490 2016-09-20 15:42:34.219 *[1780:1064272] _\ WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: -[NSNull integerValue]: unrecognized selector sent to instance 0x19f8ca490 2016-09-20 15:43:34.255 ***[1780:1064272] APIBase request didFailWithError

iVanPan commented 8 years ago

@junhui75165 上面的警告只是告诉内存不足了而已,没有影响的,新建一个工程跑我提供的Demo也不行嘛?你的Cordova cordova-ios 的版本是多少?

junhui75165 commented 8 years ago

@iVanPan 刚才测试的那个不是新的工程,刚新建一个工程,跑你的例子好像又没问题,那我再检查一下我的代码才行o(╯□╰)o