jpush-react-native icon indicating copy to clipboard operation
jpush-react-native copied to clipboard

ios build 失败

Open firehand33 opened this issue 4 years ago • 9 comments

你的运行环境

  • 插件版本:
  • react-native 版本:0.61.5
  • jcore-react-native 版本: 1.7.5
  • jpush-react-native 版本: 2.7.5

Debug logs

iOS 的日志:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_JCOREIntegrate", referenced from:
      objc-class-ref in libjpush-ios-3.2.8.a(JPUSHService.o)
  "_OBJC_CLASS_$_JCORELog", referenced from:
      objc-class-ref in libjpush-ios-3.2.8.a(JPUSHService.o)
      objc-class-ref in libjpush-ios-3.2.8.a(JPUSHHelper.o)
  "_kJPFNetworkFailedRegisterNotification", referenced from:
      -[RCTJPushModule init] in RCTJPushModule.o
  "_kJPFNetworkDidCloseNotification", referenced from:
      -[RCTJPushModule init] in RCTJPushModule.o
  "_kJPFNetworkDidLoginNotification", referenced from:
      -[RCTJPushModule init] in RCTJPushModule.o
      -[RCTJPushModule convertConnect:] in RCTJPushModule.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Pod install 了

Detected React Native module pods for JCore and JPush
Analyzing dependencies
Downloading dependencies
Installing JCore (1.7.5)
Installing JPush (2.7.5)
Generating Pods project
Integrating client project
Pod installation complete! There are 48 dependencies from the Podfile and 52 total pods installed.

在Header Search Paths 加了以下这些也无效

"${PODS_ROOT}/Headers/Public"
"${PODS_ROOT}/Headers/Public/JCore"
"${PODS_ROOT}/Headers/Public/JPush"

firehand33 avatar Apr 22 '20 09:04 firehand33

一样的问题,求解决方法

neverlist avatar Jun 02 '20 02:06 neverlist

一样的问题

chj-damon avatar Jun 11 '20 05:06 chj-damon

请问解决了吗。 @firehand33

zhllucky avatar Jul 30 '20 03:07 zhllucky

同问,手动添加了RCTJCoreModule.xcodeproj和RCTJPushModule.xcodeproj 将.a文件添加了,但是又报'React/RCTBridge.h' file not found,什么鬼东西

cxt19951016 avatar Aug 28 '20 02:08 cxt19951016

@firehand33 查看你的pod文件,看看里面有没有use_frameworks! 如果有,就会报这些错误,可以移除use_frameworks!或者修改Jcore pods文件

cxt19951016 avatar Sep 09 '20 02:09 cxt19951016

同问,手动添加了RCTJCoreModule.xcodeproj和RCTJPushModule.xcodeproj 将.a文件添加了,但是又报'React/RCTBridge.h' file not found,什么鬼东西 +1

tianNanYiHao avatar Sep 23 '20 13:09 tianNanYiHao

目前我的问题已经解决,略微分享一下(踩坑大集合):

1.首先明确的问题是 手动还是pod install 的选择问题, 两个我认为还不要同时使用, 会出现 @cxt19951016 你出现的问题, 我怀疑是库文件导入以后, 两种导入方式,让头文件冲突造成的. 2.由于我确实使用了cocoapods, 难免不去使用 pod install, 所以还是要使用 pod 方式自动集成. 3.由于我的podfile文件中, 用到swift 相关的三方库, 因此全局编译的pod 均为 framework 方式 , (use_frameworks ! 问题), 不过目前极光RN版本的 打包出来还是.a的静态库方式, 所以会报错... 4.解决办法也简单 看 [iOS podfile 如果使用use_frameworks!集成编译不过,不支持动态库吗?]https://github.com/jpush/jpush-react-native/issues/703 感谢 @17554265585

在文件jcore-react-native/JCore.podspec和jpush-react-native/JPush.podspec里添加s.static_framework = true能成功

ps: 我联系了客服,也寻求极光那边相关技术的咨询, 确定的是, pod 方式自动导入是没有问题的, 有问题的是不支持framework

tianNanYiHao avatar Sep 24 '20 10:09 tianNanYiHao

我的经历如下: 1、先pod安装,报错:"OBJC_CLASS$_JCOREIntegrate" 2、再手动安装,报错:React/RCTBridge.h,查阅无数资料,此错无解。 3、移除所有手动安装的内容: 移除手动添加的两个库 移除手动添加的Header Search Paths中的两条内容 移除手动添加的两个lib 删除Pods,重新pod install 4、正常了 5、总结,应该只要pod install就可以了,无需后面的手动安装,如果不小心两个都做了,就会导致出错,尤其是pod安装中,已经引入了Header Search Paths,手动安装中又重复引入了。

mack-wang avatar Dec 08 '20 05:12 mack-wang

use_frameworks! :linkage => :static

SkylineJia avatar May 23 '23 06:05 SkylineJia