build: 'Google-Maps-iOS-Utils/GMUHeatmapTileLayer.h' file not found. React-native

1.7k Views Asked by At

Using static link React-native-map product GMUHeatmapTileLayer.h error. I am trying to create firebase and map app, to use firebase it need use_frameworks! :linkage => :static using that, map does not work and produce multiple errors.

I followed this issue stackoverflow question to solve airmaps problem. Now i have GMUHeatmapTile.h file not found error.

without using use_frameworks! :linkage => :static project will build successfylly.

1

There are 1 best solutions below

0
On BEST ANSWER

I have solved my problem by adding these lines in pod file

  $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