iOS构建失败,因为 fatal error: module 'GoogleMapsBase' not found
我跟着这个文档https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md并使用了这个包:https://github.com/airbnb/react-native-maps
请帮我解决这个问题 . 这些是我已经完成的步骤 .
-
清除了xocde中的代码
-
进行了重建
-
做了反应原生链接react-native-maps
-
pod安装
-
在AppDelegate.m中添加了行
这是我的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"
},
提前致谢
3 回答
如果这只发生在iOS中,那么您可能缺少项目中添加的库 . 有时链接不能100%工作,你必须做一些手工工作 . 你能查看谷歌 Map 出现在图书馆部分吗?
https://facebook.github.io/react-native/docs/linking-libraries-ios.html
版本似乎不兼容,您可以通过
pod repo update
更新pod repo并再次删除Podfile.lock
然后pod install
.cd /ios
rm -rf Podfile.lock
pod repo update
pod install
最后我找到了这个错误的解决方案 .
Do not link AND use cocoapods. Do one of those two :)
参考:https://github.com/airbnb/react-native-maps/issues/1722#issuecomment-338962189