构建:找不到“Google-Maps-iOS-Utils/GMUHeatmapTileLayer.h”文件。反应本机

Sha*_*eel 0 ios react-native react-native-maps google-maps-ios-utils

使用静态链接React-native-map产品GMUHeatmapTileLayer.h报错。我正在尝试创建 firebase 和地图应用程序,要使用 firebase 它需要 use_frameworks!:linkage => :static 使用它,地图不起作用并产生多个错误。

我按照这个问题stackoverflow 问题来解决航空地图问题。现在我有 GMUHeatmapTile.h 文件未找到错误。

不使用 use_frameworks!:linkage => :静态项目将成功构建。

小智 5

我通过在 pod 文件中添加这些行解决了我的问题

  $static_library = [
    'React',
    'Google-Maps-iOS-Utils',
    'GoogleMaps',
    'react-native-google-maps',
    'react-native-maps',
    'React-hermes'
  ]

  pre_install do |installer|
    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
    installer.pod_targets.each do |pod|
      bt = pod.send(:build_type)
      if $static_library.include?(pod.name)
        puts "Overriding the build_type to static_library from static_framework for #{pod.name}"
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
    installer.pod_targets.each do |pod|
      bt = pod.send(:build_type)
      puts "#{pod.name} (#{bt})"
      puts "  linkage: #{bt.send(:linkage)} packaging: #{bt.send(:packaging)}"
    end
  end
Run Code Online (Sandbox Code Playgroud)