react-native - 未找到 React Native ios 'GoogleMaps/GoogleMaps.h' 文件

标签 react-native react-native-maps

我的应用程序有问题。
当我尝试在 上构建它时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/

相关文章:

javascript - react native android native 模块 promise 不会解决或拒绝

ubuntu - 构建时运行 android react native maps 失败

android - 找不到参数 React Native Maps 的方法 implementation()

android - react-native-maps:如何定期更新从远程服务器收到的用户位置

reactjs - 如何将 'requireNativeComponent' 添加到导出中?

javascript - React-Native-Maps 在加载后立即适合坐标

android - 相机未运行

javascript - Reactjs 使用数组动态调用选项卡面板下有卡片的组件

react-native - 更改堆栈导航器的标题高度

react-native - Redux-persist 在重新加载时不会持久保留 expo