Please help "unsupported option '-G' for target "

Trying to use Firebase auth, firestore, storage, and functions.
Xcode 16 just wont build on ios with Error (Xcode): unsupported option ‘-G’ for target ‘x86_64-apple-ios12.0-simulator’ on simulator or an actual iPhone.
Set the the Xcode Runner Target Allow non-modular includes in framework Modules to yes, and added a post install hook to the podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)

# Start of the added code for Xcode 16 compatibility
target.build_configurations.each do |config|
  # Force the deployment target for ALL pods to iOS 12.0
  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'

  # Allow non-modular includes in framework modules
  config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'

  # Disable problematic compiler flags for older dependencies
  if config.build_settings['OTHER_CFLAGS'].to_s.include?('-G')
    other_cflags = config.build_settings['OTHER_CFLAGS'].to_s.gsub(/-G\s*/, '')
    config.build_settings['OTHER_CFLAGS'] = other_cflags
  end

  # Add privacy descriptions required by Firebase
  config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
    '$(inherited)',
    'PERMISSION_CAMERA=1',
  ]
end
# End of the added code

end
These fixes worked for me when I was building a Swift app, but it isn’t working for Flutter.
I tried upgrading, downgrading xcode and pods, and using SPM on xcode but nothing worked.