我的应用程序有问题。
当我尝试在 上构建它时Android Studio 一切正常,但是当我尝试在 上构建它时Xcode 我遇到错误并且构建失败。
原因似乎来自AirMaps:
词法或预处理器问题'GoogleMaps/GoogleMaps.h'
文件未找到
AIRGoogleMapUrlTile.h
这很奇怪,因为直到现在它都运行良好,我找不到原因。我正在使用:
- "react": "16.0.0-alpha.6",
- "react-native": "0.43.3",
- "react-native-maps": "^0.21.0"
这是我的 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
你能帮我吗,提前致谢
编辑:
这是标题搜索路径。
Header Search Paths
最佳答案
如果您使用 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'
visit the documentation
关于react-native - 未找到 React Native ios 'GoogleMaps/GoogleMaps.h' 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50837186/