reat nativ导入jpush发生报错linker command failed with exit code 1 (use -v to see invocation)


(墨狂之逸才) #1

查看官方的github下的issue下的问题


我加了libresolv.tbd和libresolv.9.tbd
都没有效果还是报这个错误
报错如下:

ld: warning: object file (/Users/inkcrazy/Library/Developer/Xcode/DerivedData/SecurityPlatApp-cibctoktgbpwsahkrmmwzsciirci/Build/Products/Debug-iphoneos/libLottieReactNative.a(LRNAnimationViewManager.o)) was built for newer iOS version (9.2) than being linked (9.0)
ld: warning: object file (/Users/inkcrazy/Library/Developer/Xcode/DerivedData/SecurityPlatApp-cibctoktgbpwsahkrmmwzsciirci/Build/Products/Debug-iphoneos/libLottieReactNative.a(LRNContainerView.o)) was built for newer iOS version (9.2) than being linked (9.0)
ld: warning: object file (/Users/inkcrazy/Library/Developer/Xcode/DerivedData/SecurityPlatApp-cibctoktgbpwsahkrmmwzsciirci/Build/Products/Debug-iphoneos/libRCTJAnalyticsModule.a(RCTJAnalyticsModule.o)) was built for newer iOS version (10.3) than being linked (9.0)
ld: warning: object file (/Users/inkcrazy/Library/Developer/Xcode/DerivedData/SecurityPlatApp-cibctoktgbpwsahkrmmwzsciirci/Build/Products/Debug-iphoneos/libRCTJShareModule.a(RCTJShareModule.o)) was built for newer iOS version (10.3) than being linked (9.0)
Undefined symbols for architecture arm64:
  "_JCORECheckFormatOfMobileNumber", referenced from:
      -[JPUSHService setMobileNumber:completion:] in libjpush-ios-3.1.0.a(JPUSHService.o)
      -[JPUSHService setMobileNumber:completion:] in libRCTJPushModule.a(JPUSHService.o)
  "_JCOREDisplayVersion", referenced from:
      ___92+[JPUSHService commonSetupWithOption:appKey:channel:apsForProduction:advertisingIdentifier:]_block_invoke in libjpush-ios-3.1.0.a(JPUSHService.o)
      ___92+[JPUSHService commonSetupWithOption:appKey:channel:apsForProduction:advertisingIdentifier:]_block_invoke in libRCTJPushModule.a(JPUSHService.o)
      +[JANALYTICSService setupWithConfig:] in libRCTJAnalyticsModule.a(JANALYTICSService.o)
      +[JSHAREService setupWithConfig:] in libRCTJShareModule.a(JSHAREService.o)
  "_JCOREGetBuildVersion", referenced from:
      ___92+[JPUSHService commonSetupWithOption:appKey:channel:apsForProduction:advertisingIdentifier:]_block_invoke in libjpush-ios-3.1.0.a(JPUSHService.o)
      ___92+[JPUSHService commonSetupWithOption:appKey:channel:apsForProduction:advertisingIdentifier:]_block_invoke in libRCTJPushModule.a(JPUSHService.o)
      +[JANALYTICSService setupWithConfig:] in libRCTJAnalyticsModule.a(JANALYTICSService.o)
      +[JSHAREService setupWithConfig:] in libRCTJShareModule.a(JSHAREService.o)
  "_JPUSHBase64", referenced from:
      -[JPUSHBadgeNumberReportRequest p_generateRequestHead] in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      -[JPUSHBadgeNumberReportRequest p_generateRequestHead] in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
  "_JPUSHConvertTokenDataToString", referenced from:
      -[JPUSHDeviceTokenController judgeAndSetDeviceToken:] in libjpush-ios-3.1.0.a(JPUSHDeviceTokenController.o)
      -[JPUSHDeviceTokenController judgeAndSetDeviceToken:] in libRCTJPushModule.a(JPUSHDeviceTokenController.o)
  "_JPUSHDecodeDataFromBuffer", referenced from:
      -[JPUSHTagsResponse initWithBuffer:length:] in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      -[JPUSHAliasResponse initWithBuffer:length:] in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      -[JPUSHAliasResponse initWithBuffer:length:] in libRCTJPushModule.a(JPUSHAliasOperation.o)
      -[JPUSHTagsResponse initWithBuffer:length:] in libRCTJPushModule.a(JPUSHTagsOperation.o)
  "_JPUSHGetCurrentTimestamp", referenced from:
      -[JPUSHTagAlias setTagAliasUsingCallback:] in libjpush-ios-3.1.0.a(JPUSHTagAlias.o)
      -[JPUSHTagAliasManagerController tagOperate:type:andCompletion:andSeq:] in libjpush-ios-3.1.0.a(JPUSHTagAliasManagerController.o)
      -[JPUSHTagAliasManagerController aliasOperate:type:andCompletion:andSeq:] in libjpush-ios-3.1.0.a(JPUSHTagAliasManagerController.o)
      -[JPUSHTagAliasManagerController handleServerUnavaiableResponseWith:andContent:] in libjpush-ios-3.1.0.a(JPUSHTagAliasManagerController.o)
      -[JPUSHTagAliasManagerController isFreezeReport] in libjpush-ios-3.1.0.a(JPUSHTagAliasManagerController.o)
      -[JPUSHTagAlias setTagAliasUsingCallback:] in libRCTJPushModule.a(JPUSHTagAlias.o)
      -[JPUSHTagAliasManagerController tagOperate:type:andCompletion:andSeq:] in libRCTJPushModule.a(JPUSHTagAliasManagerController.o)
      ...
  "_JPUSHGetDateAndTimeFromTimestamp", referenced from:
      -[JANALYTICSRequestSession setViewStart:] in libRCTJAnalyticsModule.a(JANALYTICSRequestSession.o)
      -[JANALYTICSRequestSession setViewStop:] in libRCTJAnalyticsModule.a(JANALYTICSRequestSession.o)
  "_JPUSHJSONData", referenced from:
      -[JPUSHTagsRequest packData] in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      -[JPUSHAliasRequest packData] in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      -[JPUSHBadgeNumberReportRequest packetData] in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      -[JPUSHSetTagAlias requestJsonData] in libjpush-ios-3.1.0.a(JPUSHSetTagAlias.o)
      -[JPUSHAliasRequest packData] in libRCTJPushModule.a(JPUSHAliasOperation.o)
      -[JPUSHBadgeNumberReportRequest packetData] in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
      -[JPUSHTagsRequest packData] in libRCTJPushModule.a(JPUSHTagsOperation.o)
      ...
  "_JPUSHJSONObject", referenced from:
      -[JPUSHTagAlias doSetTagsAliasCallbackWithRetJson:] in libjpush-ios-3.1.0.a(JPUSHTagAlias.o)
      -[JPUSHTagsResponse initWithBuffer:length:] in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      -[JPUSHAliasResponse initWithBuffer:length:] in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      -[JPUSHTagAlias doSetTagsAliasCallbackWithRetJson:] in libRCTJPushModule.a(JPUSHTagAlias.o)
      -[JPUSHAliasResponse initWithBuffer:length:] in libRCTJPushModule.a(JPUSHAliasOperation.o)
      -[JPUSHTagsResponse initWithBuffer:length:] in libRCTJPushModule.a(JPUSHTagsOperation.o)
  "_JPUSHStringHashingByMD5", referenced from:
      -[JPUSHBadgeNumberReportRequest p_generateRequestHead] in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      -[JPUSHBadgeNumberReportRequest p_generateRequestHead] in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
  "_OBJC_CLASS_$_JCOREClientController", referenced from:
      objc-class-ref in libRCTJShareModule.a(JSHAREService.o)
      objc-class-ref in libRCTJShareModule.a(JSHAREClientController.o)
  "_OBJC_CLASS_$_JCOREInterface", referenced from:
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHService.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHTagAlias.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHTagAliasManagerController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHBadgeNumberController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHUserPropertyController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHDeviceTokenController.o)
      ...
  "_OBJC_CLASS_$_JPUSHFileHelper", referenced from:
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHTagAlias.o)
      objc-class-ref in libRCTJPushModule.a(JPUSHTagAlias.o)
  "_OBJC_CLASS_$_JPUSHLog", referenced from:
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHService.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHLocalNotificationController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHTagAlias.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHBadgeNumberController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHUserPropertyController.o)
      objc-class-ref in libjpush-ios-3.1.0.a(JPUSHDeviceTokenController.o)
      ...
  "_OBJC_CLASS_$_JPUSHPushConfigController", referenced from:
      objc-class-ref in libRCTJShareModule.a(JSHAREService.o)
  "_OBJC_CLASS_$_JPUSHReceivedPacketController", referenced from:
      _OBJC_CLASS_$_JPUSHTagsResponse in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      _OBJC_CLASS_$_JPUSHAliasResponse in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      _OBJC_CLASS_$_JPUSHAliasResponse in libRCTJPushModule.a(JPUSHAliasOperation.o)
      _OBJC_CLASS_$_JPUSHTagsResponse in libRCTJPushModule.a(JPUSHTagsOperation.o)
  "_OBJC_CLASS_$_JPUSHReportRequest", referenced from:
      _OBJC_CLASS_$_JPUSHBadgeNumberReportRequest in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      _OBJC_CLASS_$_JPUSHMessageReportRequest in libjpush-ios-3.1.0.a(JPUSHMessageReport.o)
      _OBJC_CLASS_$_JPUSHBadgeNumberReportRequest in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
      _OBJC_CLASS_$_JPUSHMessageReportRequest in libRCTJPushModule.a(JPUSHMessageReport.o)
      _OBJC_CLASS_$_JANALYTICSEventReportRequest in libRCTJAnalyticsModule.a(JANALYTICSEventReport.o)
      _OBJC_CLASS_$_JANALYTICSFrequencyRequest in libRCTJAnalyticsModule.a(JANALYTICSFrequencyReport.o)
      _OBJC_CLASS_$_JANALYTICSPageFlowReportRequest in libRCTJAnalyticsModule.a(JANALYTICSPageFlowReport.o)
      ...
  "_OBJC_CLASS_$_JPUSHReportResponse", referenced from:
      _OBJC_CLASS_$_JPUSHBadgeNumberReportResponse in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      _OBJC_CLASS_$_JPUSHMessageReportResponse in libjpush-ios-3.1.0.a(JPUSHMessageReport.o)
      _OBJC_CLASS_$_JPUSHBadgeNumberReportResponse in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
      _OBJC_CLASS_$_JPUSHMessageReportResponse in libRCTJPushModule.a(JPUSHMessageReport.o)
      _OBJC_CLASS_$_JANALYTICSEventReportResponse in libRCTJAnalyticsModule.a(JANALYTICSEventReport.o)
      _OBJC_CLASS_$_JANALYTICSFrequencyResponse in libRCTJAnalyticsModule.a(JANALYTICSFrequencyReport.o)
      _OBJC_CLASS_$_JANALYTICSPageFlowReportResponse in libRCTJAnalyticsModule.a(JANALYTICSPageFlowReport.o)
      ...
  "_OBJC_CLASS_$_JPUSHRequest", referenced from:
      _OBJC_CLASS_$_JPUSHTagsRequest in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      _OBJC_CLASS_$_JPUSHAliasRequest in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      _OBJC_CLASS_$_JPUSHUserPropertyRequest in libjpush-ios-3.1.0.a(JPUSHUserProperty.o)
      _OBJC_CLASS_$_JPUSHSetTagAlias in libjpush-ios-3.1.0.a(JPUSHSetTagAlias.o)
      _OBJC_CLASS_$_JPUSHAliasRequest in libRCTJPushModule.a(JPUSHAliasOperation.o)
      _OBJC_CLASS_$_JPUSHTagsRequest in libRCTJPushModule.a(JPUSHTagsOperation.o)
      _OBJC_CLASS_$_JPUSHUserPropertyRequest in libRCTJPushModule.a(JPUSHUserProperty.o)
      ...
  "_OBJC_CLASS_$_JPUSHResponse", referenced from:
      _OBJC_CLASS_$_JPUSHUserPropertyResponse in libjpush-ios-3.1.0.a(JPUSHUserProperty.o)
      _OBJC_CLASS_$_JPUSHUserPropertyResponse in libRCTJPushModule.a(JPUSHUserProperty.o)
      _OBJC_CLASS_$_JANALYTICSUserPropertyResponse in libRCTJAnalyticsModule.a(JANALYTICSUserProperty.o)
  "_OBJC_IVAR_$_JPUSHRequest._packetData", referenced from:
      -[JPUSHTagsRequest packData] in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      -[JPUSHAliasRequest packData] in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      -[JPUSHUserPropertyRequest packData] in libjpush-ios-3.1.0.a(JPUSHUserProperty.o)
      -[JPUSHSetTagAlias packData] in libjpush-ios-3.1.0.a(JPUSHSetTagAlias.o)
      -[JPUSHAliasRequest packData] in libRCTJPushModule.a(JPUSHAliasOperation.o)
      -[JPUSHTagsRequest packData] in libRCTJPushModule.a(JPUSHTagsOperation.o)
      -[JPUSHUserPropertyRequest packData] in libRCTJPushModule.a(JPUSHUserProperty.o)
      ...
  "_OBJC_METACLASS_$_JPUSHReceivedPacketController", referenced from:
      _OBJC_METACLASS_$_JPUSHTagsResponse in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      _OBJC_METACLASS_$_JPUSHAliasResponse in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      _OBJC_METACLASS_$_JPUSHAliasResponse in libRCTJPushModule.a(JPUSHAliasOperation.o)
      _OBJC_METACLASS_$_JPUSHTagsResponse in libRCTJPushModule.a(JPUSHTagsOperation.o)
  "_OBJC_METACLASS_$_JPUSHReportRequest", referenced from:
      _OBJC_METACLASS_$_JPUSHBadgeNumberReportRequest in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      _OBJC_METACLASS_$_JPUSHMessageReportRequest in libjpush-ios-3.1.0.a(JPUSHMessageReport.o)
      _OBJC_METACLASS_$_JPUSHBadgeNumberReportRequest in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
      _OBJC_METACLASS_$_JPUSHMessageReportRequest in libRCTJPushModule.a(JPUSHMessageReport.o)
      _OBJC_METACLASS_$_JANALYTICSEventReportRequest in libRCTJAnalyticsModule.a(JANALYTICSEventReport.o)
      _OBJC_METACLASS_$_JANALYTICSFrequencyRequest in libRCTJAnalyticsModule.a(JANALYTICSFrequencyReport.o)
      _OBJC_METACLASS_$_JANALYTICSPageFlowReportRequest in libRCTJAnalyticsModule.a(JANALYTICSPageFlowReport.o)
      ...
  "_OBJC_METACLASS_$_JPUSHReportResponse", referenced from:
      _OBJC_METACLASS_$_JPUSHBadgeNumberReportResponse in libjpush-ios-3.1.0.a(JPUSHBadgeNumberReport.o)
      _OBJC_METACLASS_$_JPUSHMessageReportResponse in libjpush-ios-3.1.0.a(JPUSHMessageReport.o)
      _OBJC_METACLASS_$_JPUSHBadgeNumberReportResponse in libRCTJPushModule.a(JPUSHBadgeNumberReport.o)
      _OBJC_METACLASS_$_JPUSHMessageReportResponse in libRCTJPushModule.a(JPUSHMessageReport.o)
      _OBJC_METACLASS_$_JANALYTICSEventReportResponse in libRCTJAnalyticsModule.a(JANALYTICSEventReport.o)
      _OBJC_METACLASS_$_JANALYTICSFrequencyResponse in libRCTJAnalyticsModule.a(JANALYTICSFrequencyReport.o)
      _OBJC_METACLASS_$_JANALYTICSPageFlowReportResponse in libRCTJAnalyticsModule.a(JANALYTICSPageFlowReport.o)
      ...
  "_OBJC_METACLASS_$_JPUSHRequest", referenced from:
      _OBJC_METACLASS_$_JPUSHTagsRequest in libjpush-ios-3.1.0.a(JPUSHTagsOperation.o)
      _OBJC_METACLASS_$_JPUSHAliasRequest in libjpush-ios-3.1.0.a(JPUSHAliasOperation.o)
      _OBJC_METACLASS_$_JPUSHUserPropertyRequest in libjpush-ios-3.1.0.a(JPUSHUserProperty.o)
      _OBJC_METACLASS_$_JPUSHSetTagAlias in libjpush-ios-3.1.0.a(JPUSHSetTagAlias.o)
      _OBJC_METACLASS_$_JPUSHAliasRequest in libRCTJPushModule.a(JPUSHAliasOperation.o)
      _OBJC_METACLASS_$_JPUSHTagsRequest in libRCTJPushModule.a(JPUSHTagsOperation.o)
      _OBJC_METACLASS_$_JPUSHUserPropertyRequest in libRCTJPushModule.a(JPUSHUserProperty.o)
      ...
  "_OBJC_METACLASS_$_JPUSHResponse", referenced from:
      _OBJC_METACLASS_$_JPUSHUserPropertyResponse in libjpush-ios-3.1.0.a(JPUSHUserProperty.o)
      _OBJC_METACLASS_$_JPUSHUserPropertyResponse in libRCTJPushModule.a(JPUSHUserProperty.o)
      _OBJC_METACLASS_$_JANALYTICSUserPropertyResponse in libRCTJAnalyticsModule.a(JANALYTICSUserProperty.o)
  "_kJPFNetworkDidCloseNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule reactJSDidload] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
      -[RCTJPushModule reactJSDidload] in libRCTJPushModule.a(RCTJPushModule.o)
  "_kJPFNetworkDidLoginNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule reactJSDidload] in libJPushRN.a(RCTJPushModule.o)
      -[JPUSHClientController observeNotifications] in libjpush-ios-3.1.0.a(JPUSHClientController.o)
      -[JPUSHClientController unobserveNotifications] in libjpush-ios-3.1.0.a(JPUSHClientController.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
      -[RCTJPushModule reactJSDidload] in libRCTJPushModule.a(RCTJPushModule.o)
      -[JPUSHClientController observeNotifications] in libRCTJPushModule.a(JPUSHClientController.o)
      ...
  "_kJPFNetworkDidReceiveMessageNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
  "_kJPFNetworkDidRegisterNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
      -[JSHAREClientController observeNotifications] in libRCTJShareModule.a(JSHAREClientController.o)
      -[JSHAREClientController unobserveNotifications] in libRCTJShareModule.a(JSHAREClientController.o)
  "_kJPFNetworkDidSetupNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
  "_kJPFNetworkFailedRegisterNotification", referenced from:
      -[JSHAREClientController observeNotifications] in libRCTJShareModule.a(JSHAREClientController.o)
      -[JSHAREClientController unobserveNotifications] in libRCTJShareModule.a(JSHAREClientController.o)
  "_kJPFNetworkIsConnectingNotification", referenced from:
      -[RCTJPushModule init] in libJPushRN.a(RCTJPushModule.o)
      -[RCTJPushModule init] in libRCTJPushModule.a(RCTJPushModule.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

(HuminiOS) #2

检查 jcore-react-native 是否 link 成功。


(HuminiOS) #3

如果确定依据 link 成功,可以将 jcore 和 jpush 插件升级到最新版本。


(墨狂之逸才) #4
{
  "name": "SecurityPlatApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "janalytics-react-native": "^1.1.6",
    "jcore-react-native": "^1.2.12",
    "jpush-react-native": "^2.2.11",
    "jshare-react-native": "^1.3.10",
    "lottie-react-native": "^2.5.10",
    "querystring": "^0.2.0",
    "react": "16.6.0-alpha.8af6728",
    "react-native": "0.57.4",
    "react-native-amap-geolocation": "^0.3.2",
    "react-native-camera": "^1.2.0",
    "react-native-device-info": "^0.24.3",
    "react-native-fs": "^2.11.17",
    "react-native-i18n": "^2.0.15",
    "react-native-nfc-manager": "^0.7.0",
    "react-native-storage": "^0.2.2",
    "react-native-swiper": "^1.5.13",
    "react-native-webview": "^2.13.0",
    "react-navigation": "^2.18.2",
    "teaset": "^0.5.10"
  },
  "devDependencies": {
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

# 下面两行是指明依赖库的来源地址
source 'https://github.com/CocoaPods/Specs.git'

# 说明平台是ios,版本是9.0
platform :ios, '9.0'

# 忽略引入库的所有警告(强迫症者的福音啊)
inhibit_all_warnings!

target 'SecurityPlatApp' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
#  use_frameworks!

pod 'JPushRN', :path => '../node_modules/jpush-react-native'

# 'node_modules'目录一般位于根目录中
# 但是如果你的结构不同,那你就要根据实际路径修改下面的`:path`
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # 如果RN版本 >= 0.47则加入此行
'DevSupport', # 如果RN版本 >= 0.43,则需要加入此行才能开启开发者菜单
'RCTText',
'RCTNetwork',
'RCTWebSocket', # 调试功能需要此模块
'RCTAnimation', # FlatList和原生动画功能需要此模块
# 在这里继续添加你所需要的其他RN模块
]
# 如果你的RN版本 >= 0.42.0,则加入下面这行
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

# 如果RN版本 >= 0.45则加入下面三个第三方编译依赖
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Pods for SecurityPlatApp

  target 'SecurityPlatAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

我是先项目根目录里面npm install
然后iOS项目目录pod init
pod install


(墨狂之逸才) #5

这个iOS项目好像是react native自动生成的,是不是不可以用cocoapods?


(12) #6

看 readme 说明额

如果是原生应用集成 react-native)使用 CocoaPods 安装
如果你的 React Native 是通过 Cocoapods 来集成的则使用下面两个步骤来集成,注意: 使用 pod 就不要使用 react-native link 了,不然会有冲突。

如果不是,就选择另一种方式。


(墨狂之逸才) #7

jpush 的版本是:
“jcore-react-native”: “^1.2.12”,
“jpush-react-native”: “^2.2.11”,

npm install
pod init
pod install(都是按照GitHub的自动步骤cocoapods,和手动步骤操作的)
我没有用react-native link,但还是冲突了,报上面的错误


(墨狂之逸才) #8

我刚才删除jpush发现还是报错,还要把套餐全部删除才可以,还有jshare jAnalysis, 主要是还是要用这些东西的


(HuminiOS) #9

自动生成的项目不确定 可不可以使用 cocoapods 我这边也没试过,
不过自定生成的项目直接使用 react-native link 就行。


(HuminiOS) #10

如果你其他插件 (jshare janalysis)用的 react-native link ,而 单独 jpush 使用 pod 那肯定是不行的。


(墨狂之逸才) #11

那我先把其他两个pod补上看看,有问题我再来问问看


(HuminiOS) #12

为什么执着于用pod,你的情况明显用 react-native link 更方便。


(墨狂之逸才) #13

我知道了,刚接手的项目,原来jshare janalysis,jpush已经link了,还有其他一些有要求的库只能pod安装我却不知道,遗漏了。