Mat*_*rre 5 react-native react-native-maps
我的应用程序有问题。
当我尝试在Android Studio上构建它时一切正常,但是当我尝试在Xcode上构建它时出现错误并且构建失败。
原因似乎来自AirMaps:
词法或预处理器问题
'GoogleMaps/GoogleMaps.h' 文件未找到
AIRGoogleMapUrlTile.h
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为直到现在它都运行良好,我找不到原因。
我正在使用:
- "react": "16.0.0-alpha.6",
- "react-native": "0.43.3",
- "react-native-maps": "^0.21.0"
Run Code Online (Sandbox Code Playgroud)
这是我的 Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Situaction' do
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
pod 'Fabric'
pod 'Crashlytics'
pod 'GoogleMaps'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
end
end
Run Code Online (Sandbox Code Playgroud)
你能帮我吗,
提前致谢
编辑:
这里是标题搜索路径。
标题搜索路径
如果您使用的是 React Native 0.60 及更高版本,请将以下内容添加到Podfile上面的use_native_modules!函数中并pod install在 ios 文件夹中运行:
# React Native Maps dependencies
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils'
Run Code Online (Sandbox Code Playgroud)
Mat*_*rre -1
好的,我刚刚找到了一个有效的解决方案:
在 podfile 中添加 pod Google-Maps-iOS-Utils
从库中删除 AirMaps.xcodeproj
从链接二进制文件中删除 libAirMap.a
但现在我遇到了一个新问题:地图出现了,但现在我无法使用 fitToCooperatives,因为出现错误:
Unknown argument type 'AIRMapCoordinatesArray' in method - [AIRGoogleMapManager fitToCoordinates:coordinates:edgePadding:animated: ). Extend RCTConvert to support this type.
Run Code Online (Sandbox Code Playgroud)
当我查看调试器时,它告诉我:
Warning: Native component for "AIRMap" does not exist
Run Code Online (Sandbox Code Playgroud)
(更多信息在我报告的react-native-maps问题中)
编辑:
我在项目中添加了 AirMaps 文件夹,一切似乎都工作正常
| 归档时间: |
|
| 查看次数: |
8213 次 |
| 最近记录: |