googlemaps / google-maps-ios-utils

Google Maps SDK for iOS Utility Library
https://developers.google.com/maps/documentation/ios-sdk/utility/
Apache License 2.0
714 stars 401 forks source link

Cannot find type 'GMUWeightedLatLng' in scope #461

Closed zhenguet closed 6 months ago

zhenguet commented 6 months ago

Something's wrong in my project. But I don't know where is wrong to fix

ios/Pods/Google-Maps-iOS-Utils/src/Heatmap/HeatMapInterpolationPoints.swift

"react": "18.2.0",
"react-native": "0.73.5",
"react-native-maps": "^1.11.3"

podfile:

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, 13.4
prepare_react_native_project!

def share_pods (target_name)
  # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
  # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
  #
  # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
  # ```js
  # module.exports = {
  #   dependencies: {
  #     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
  # ```
  flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

  linkage = ENV['USE_FRAMEWORKS']
  if linkage != nil
    Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
    use_frameworks! :linkage => linkage.to_sym
  end

  target target_name do
    pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'
    pod 'react-native-maps', :path => '../node_modules/react-native-maps'
    pod 'RNFS', :path => '../node_modules/react-native-fs'
    pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

    config = use_native_modules!

    use_react_native!(
      :path => config[:reactNativePath],
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable the next line.
      :flipper_configuration => flipper_config,
      # An absolute path to your application root.
      :app_path => "#{Pod::Config.instance.installation_root}/.."
    )

    post_install do |installer|
      # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
      react_native_post_install(
        installer,
        config[:reactNativePath],
        :mac_catalyst_enabled => false
      )

      installer.pods_project.targets.each do |target|
        if target.name == "React-Core.common-AccessibilityResources"
          target.remove_from_project
        end

        target.build_configurations.each do |config|
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
          config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
          config.build_settings['OTHER_SWIFT_FLAGS'] = '-no-verify-emitted-module-interface'
        end

        if (target.name&.eql?('FBReactNativeSpec'))
          target.build_phases.each do |build_phase|
            if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
              target.build_phases.move(build_phase, 0)
            end
          end
        end
      end

      installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
            end
        end
      end

      xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`
      installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
              # For xcode 15+ only
              if config.base_configuration_reference && Integer(xcode_base_version) >= 15
                  xcconfig_path = config.base_configuration_reference.real_path
                  xcconfig = File.read(xcconfig_path)
                  xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
                  File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
              end
          end
      end

      installer.pods_project.build_configurations.each do |config|
          config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
      end
    end
  end
end

share_pods('Demo') 

Xcode 15.2

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)

Screenshot 2024-03-13 at 10 08 27
wangela commented 6 months ago

If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.

@zhenguet Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

zhenguet commented 6 months ago

turn off

          config.build_settings['OTHER_SWIFT_FLAGS'] = '-no-verify-emitted-module-interface'