美文网首页
react native之iOS导入cocoaPod的配置

react native之iOS导入cocoaPod的配置

作者: 米开朗骑騾 | 来源:发表于2019-11-07 22:26 被阅读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 错误原因就是缺少依赖或库

    相关文章

      网友评论

          本文标题:react native之iOS导入cocoaPod的配置

          本文链接:https://www.haomeiwen.com/subject/mpzogftx.html