react native之iOS导入cocoaPod的配置

2019-11-07  本文已影响0人  米开朗骑騾

cocoa Pod里的写法如下 报错Native module cannot be null

platform :ios, '8.0'

target 'mapShowTest' do

pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # Needed for debugging
    'RCTAnimation', # Needed for FlatList and animations running on native UI thread
    # Add any other subspecs you want to use in your project
    'RCTActionSheet',
    'RCTImage',
    'RCTSettings',
    'RCTLinkingIOS',
    'RCTVibration',
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

# Third party deps podspec link
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'


  pod 'AMap3DMap'
  pod 'AMapLocation'
  pod 'AMapSearch'

end

红框里需配置,不然跑不起来 ,rn官方文档也已说明


image.png

Native module cannot be null 错误原因就是缺少依赖或库

上一篇 下一篇

猜你喜欢

热点阅读