React Native iOS - fatal error: module 'GoogleMapsBase' not found

React Native iOS - fatal error: module 'GoogleMapsBase' not found

iOS 由于 fatal error: module 'GoogleMapsBase' not found 构建失败 我也关注了这个文档 https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md and used this package : https://github.com/airbnb/react-native-maps

这些是我已经完成的步骤。

这是我的 Podfile

target 'ios_user' do
  rn_path = '../node_modules/react-native'

  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/Yoga.podspec"
  pod 'React', path: rn_path, subspecs: [
    'Core',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
    'BatchedBridge'
  ]

  pod 'GoogleMaps'  
  pod 'react-native-maps', path: '../node_modules/react-native-maps'
  pod 'react-native-google-maps', path: '../node_modules/react-native-maps'  
end

这些是 package.json 文件中的依赖项

"dependencies": {
    "moment": "^2.19.1",
    "react": "16.0.0-beta.5",
    "react-native": "0.49.2",
    "react-native-elements": "^0.17.0",
    "react-native-maps": "^0.17.1",
    "react-native-simple-radio-button": "^2.6.2",
    "react-native-vector-icons": "^4.4.0",
    "validate.js": "^0.11.1"
  },

如果这仅发生在 iOS 中,则可能是您缺少项目中添加的库。有时 link 不能 100% 工作,你必须做一些手工工作。你能检查 Google 地图是否出现在图书馆部分吗?

https://facebook.github.io/react-native/docs/linking-libraries-ios.html

版本似乎不兼容,您可以通过 pod repo update 更新 pod 存储库并删除您的 Podfile.lock 然后再次 pod install

  1. cd /ios
  2. rm -rf Podfile.lock
  3. pod repo update
  4. pod install

我终于找到了这个错误的解决方案。

不要link并使用椰子足类动物。做这两个中的一个:)

参考:https://github.com/airbnb/react-native-maps/issues/1722#issuecomment-338962189

我会在这里添加一个答案,以防万一有人遇到这个问题。

我的问题是我的共享扩展的部署目标与工作区和 Pods 文件不匹配。该项目将为调试构建,我可以 运行 模拟器上的应用程序,但我无法存档该应用程序。更新共享扩展的部署目标后,我就可以将应用程序部署到 App Store。