折腾:
【已解决】Xcode9提示:runtime UI API called from background thread UIApplication currentUserNotificationSettings must be used from main thread only
期间,把JPush从3.0.1升级到了3.0.6后,Xcode9中链接出错了:
Undefined symbols for architecture x86_64: “_OBJC_CLASS_$_JPUSHRegisterEntity”, referenced from: objc-class-ref in AppDelegate.o “_kJPFNetworkDidSetupNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_kJPFNetworkDidCloseNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_kJPFNetworkDidRegisterNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_kJPFNetworkDidLoginNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_kJPFServiceErrorNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_kJPFNetworkDidReceiveMessageNotification”, referenced from: __T06SRTDev11AppDelegateC16listenRemotePushyyF in AppDelegate.o “_OBJC_CLASS_$_JPUSHService”, referenced from: objc-class-ref in MainViewController.o objc-class-ref in AppDelegate.o ld: symbol(s) not found for architecture x86_64 |
_OBJC_CLASS_$_JPUSHRegisterEntity referenced from
ios 推送demo运行不了啊 – 极光技术 / JPush – 极光社区
说是3.0版本以上就不支持i386的模拟器
-》但是我之前就是3.0.1,模拟器正常运行的啊
-》所以换到3.0.6,也不该去修改项目的配置,去改所谓的Build Active Architecture Only
编译错误 Undefined symbols for architecture i386: | iOS开发 – CocoaChina CocoaChina_让移动开发更简单
iOS “_OBJC_CLASS_$_JPUSHService”, referenced from: 解决办法 – CSDN博客
xcode8.1 iOS模拟器运行编译报错 – 极光技术 / JPush – 极光社区
导入SDK之后 模拟器跑报”_OBJC_CLASS_$_JPUSHService”, referenced错误 – 极光技术 / JPush – 极光社区
clang: error: linker command failed with exit c… – 简书
去看看:
此处是Project中
Enable Bitcode
Debug Yes
Release Yes
但是每个target中,都是NO:
Enable Bitcode
Debug No
Release No
去把(此处三个)Target中都改为:
Enable Bitcode
Debug Yes
Release No
看看
结果依旧。
待会再去去试试:
Build Active Architecture Only改为YES
Xcode9 Jpush Undefined symbols for architecture x86_64
现在把:
Release的Build Active Architecture Only改为YES
问题依旧。
ios – Xcode 8.1 Undefined symbols for architecture x86_64 Error – Stack Overflow
发现是支持的x86_64的:
➜ Lib pwd /Users/crifan/dev/dev_tool/JPush/jpush-ios-3.0.6-release/Lib ➜ Lib ll total 30480 -rwxr-xr-x@ 1 crifan staff 25K 7 3 15:19 JPUSHService.h -rwxr-xr-x@ 1 crifan staff 12M 7 3 15:19 jcore-ios-1.1.5.a -rwxr-xr-x@ 1 crifan staff 2.6M 7 3 15:19 jpush-ios-3.0.6.a ➜ Lib lipo -info jpush-ios-3.0.6.a Architectures in the fat file: jpush-ios-3.0.6.a are: armv7 armv7s x86_64 arm64 ➜ Lib lipo -info jcore-ios-1.1.5.a Architectures in the fat file: jcore-ios-1.1.5.a are: armv7 armv7s x86_64 arm64 |
去看了3.0.1的也是支持x86_64的:
➜ SRT git:(master) ✗ lipo -info jpush-ios-3.0.1.a Architectures in the fat file: jpush-ios-3.0.1.a are: armv7 armv7s x86_64 arm64 ➜ SRT git:(master) ✗ lipo -info jcore-ios-1.1.0.a Architectures in the fat file: jcore-ios-1.1.0.a are: armv7 armv7s x86_64 arm64 |
换回3.0.1试试:
结果问题依旧:
即,之前正常的3.0.1的jpush库,放到这里,也是出错,所以:
感觉是哪里配置有问题了。
去清除Drived Data试试
然后clean,再重新build
去试试:
ios Undefined symbols for architecture arm64:错误解决 – BayBaymax的专栏 – CSDN博客
加上:
Linking->Other Linker Flags->-ObjC
结果:问题依旧。
Xcode Jpush Undefined symbols for architecture x86_64
问题依旧:
突然感觉,像是:
项目中编译中,没有去链接:
jpush-ios-3.0.1.a
jcore-ios-1.1.0.a
啊,所以找不到。
去把两个jpush的库拖动到link的阶段:
结果就可以了链接成功了:
那就有点奇怪了:
为何之前Xcode项目的配置中,
没有把jpush的.a的库文件:
jpush-ios-3.0.1.a
jcore-ios-1.1.0.a
放到:
Build Phases->Link Binary With Libraries中,
却也可以正常在链接的时候,自动去链接到jpush的库,不会报错
而此处,在删除了项目中的旧版本:
jpush-ios-3.0.1.a
jcore-ios-1.1.0.a
后,新拖动和拷贝新版本:
core-ios-1.1.5.a
push-ios-3.0.6.a
到项目中后,Xcode为何没有自动识别并在链接阶段自动链接找到.a的库呢?
去看看,之前的项目的配置:
发现原因了:
之前其实是在
Link Binary With Libraries
已经包含了jpush的库的
只不过是:
刚才在删除掉jpush的两个.a库文件后,Xcode自动把jpush库文件从
Link Binary With Libraries
中移除掉了,而再次拖动新版本的jpush库文件到Xcode中后,
并没有自动再去在
Link Binary With Libraries
中加上jpush的库
-》所以需要手动再去添加进来才行。
【总结】
此处,Xcode9中,jpush从3.0.1:
jpush-ios-3.0.1.a
jcore-ios-1.1.0.a
升级到3.0.6新版本:
jpush-ios-3.0.6.a
jcore-ios-1.1.5.a
时,的操作是:
直接手动删除了jpush的旧的库文件,然后再拖动新版本到Xcode项目中,(copy file)
而删除的动作,导致了Xcode中把之前在Link Frameworks and Libraries(或Link Binary With Libraries)加入的jpush的库(jpush-ios-3.0.1.a和jcore-ios-1.1.0.a)删除掉了:
而新拷贝进来的文件,Xcode并没有自动帮我们加上Link Frameworks and Libraries(或Link Binary With Libraries)的配置:
导致链接阶段,找不到对应的jpush的函数。
解决办法:
把新版本的jpush库文件拷贝到项目中后,去:
Target-》General-》Link Frameworks and Libraries
或:
Target-》Build Phase -》Link Binary With Libraries
中,把:
jpush-ios-3.0.6.a
jcore-ios-1.1.5.a
加上去:
即可。
【提示】
Xcode中:
Target-》General-》Link Frameworks and Libraries
和:
Target-》Build Phase -》Link Binary With Libraries
两个部分的设置是一样的,同步的。
-》因为我拖动jpush的库到
Target-》General-》Link Frameworks and Libraries
后,
Target-》Build Phase -》Link Binary With Libraries
自动也能看到对应jpush的库了。
转载请注明:在路上 » 【已解决】Xcode9中JPush从3.0.1升级到3.0.6后链接出错:Undefined symbols for architecture x86_64 _OBJC_CLASS_$_JPUSHRegisterEntity