【问题标题】:podspec setup for react native geolocation用于反应原生地理位置的 podspec 设置
【发布时间】:2019-02-02 13:25:41
【问题描述】:

抱歉这个菜鸟问题,但我真的不知道如何为 RN 的地理位置设置最后一行:

If you are using CocoaPods for React Native, make sure to include the RCTGeolocation sub-podspec.

我已经有一个 podfile,因为我正在遵循 RNfirebase 库中的指南, 但不确定在哪里添加 RCTGeolocation。

这是我目前拥有的:

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

  # Pods for Absent
    pod 'Firebase/Core', '~> 5.3.0'
    pod 'Firebase/Messaging', '~> 5.3.0'

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

end

这是我第一次在 mac 上自定义项目并与 pod 文件交互。 任何指针将不胜感激:D

【问题讨论】:

    标签: ios reactjs react-native cocoapods podspec


    【解决方案1】:

    这是您应该在 podfile 中添加的内容:

    pod 'React', :path => '../node_modules/react-native', :subspecs => [
      'RCTGeolocation',
    ]
    

    然后运行 ​​pod install

    【讨论】:

    • 谢谢!做到了!我最终也需要为瑜伽添加一行并将RCTNetwork 添加到React 的子规范中,但它最终再次起作用了:D
    • [!] CocoaPods 找不到 pod "React/RCTGeolocation" 的兼容版本:
    • 不是所有的 react 原生应用都有 podfile 吗?如果是这样,这一步对每个人都是强制性的吗?我正在尝试从同一链接 OP 调试我的地理位置设置:facebook.github.io/react-native/docs/geolocation.html
    【解决方案2】:

    2019 年更新:

    安装react-native-geolocation,记得cd ios; pod install

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 1970-01-01
      • 1970-01-01
      • 2019-12-25
      • 1970-01-01
      相关资源
      最近更新 更多