skip to Main Content

This is my PodFile

platform :ios, min_ios_version_supported
use_modular_headers!
prepare_react_native_project!

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 'Fixturefix' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()
 
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'

  $RNFirebaseAsStaticFramework = true
  
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => flipper_config,
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'FixturefixTests' do
    inherit! :complete
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      if ['FirebaseCoreInternal', 'GoogleUtilities'].include?(target.name)
        target.build_configurations.each do |config|
          config.build_settings['DEFINES_MODULE'] = 'YES'
        end
      end
    end
  end
end

I am using a MacBook M1 with Sequoia 15.0
Xcode version 16.0
Then I am getting this error constantly when I am building on Xcode. I have no issue building and running a new project.
unsupported option ‘-G’ for target ‘arm64-apple-ios11.0-simulator’
Things I have tried.

rm -rf Podfile
rm -rf Podfile.lock
Pod install

Also tried 
pod deintegrate
pod install 

Double checked the iOS version of 16.0
I have lost several days on this please help,

2

Answers


  1. I have resolved using the same approach here: BoringSSL-GRPC unsupported option '-G' for target 'arm64-apple-ios15.0'

    Pretty much just modify your podfile as:

      pod 'Firebase', :modular_headers => true
      pod 'FirebaseCore', :modular_headers => true
      pod 'GoogleUtilities', :modular_headers => true
      pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'
    
      $RNFirebaseAsStaticFramework = true
      
      use_react_native!(
        :path => config[:reactNativePath],
        :hermes_enabled => flags[:hermes_enabled],
        :fabric_enabled => flags[:fabric_enabled],
        :flipper_configuration => flipper_config,
        :app_path => "#{Pod::Config.instance.installation_root}/.."
      )
    
      target 'FixturefixTests' do
        inherit! :complete
      end
    
      post_install do |installer|
        react_native_post_install(
          installer,
          :mac_catalyst_enabled => false
        )
        __apply_Xcode_12_5_M1_post_install_workaround(installer)
        installer.pods_project.targets.each do |target|
          
          if target.name == 'BoringSSL-GRPC'
            target.source_build_phase.files.each do |file|
              if file.settings && file.settings['COMPILER_FLAGS']
                flags = file.settings['COMPILER_FLAGS'].split
                flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
                file.settings['COMPILER_FLAGS'] = flags.join(' ')
              end
            end
          end
          target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
          end
    
          if ['FirebaseCoreInternal', 'GoogleUtilities'].include?(target.name)
            target.build_configurations.each do |config|
              config.build_settings['DEFINES_MODULE'] = 'YES'
            end
          end
        end
      end
    end
    

    Run pod upgrade clean build folder and build again.

    I hope it helps!

    Login or Signup to reply.
  2. I have resolved this issue by following the below steps:

    Step 1 : Update cocoapods

    sudo gem install cocoapods
    
    pod repo update
    

    Step 2 : delete the android and iOS folders from your app and run flutter create .

    this is commad will create these 2 folders again (just to make sure we didn’t make any changes on them).

    Step 3 : navigate your podfile ios/Podfile and past the code below

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        if target.name == 'BoringSSL-GRPC'
          target.source_build_phase.files.each do |file|
            if file.settings && file.settings['COMPILER_FLAGS']
              flags = file.settings['COMPILER_FLAGS'].split
              flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
              file.settings['COMPILER_FLAGS'] = flags.join(' ')
            end
          end
        end
      end
    end
    

    Step 4 : run the below command to open runnder file into xcode open ios/Runner.xcworkspace

    Go to the target settings for your project.
    Under the Build Settings tab, look for Allow Non-modular Includes in Framework Modules and set it to Yes.

    • close xcode

    Step 5 : open your code editor again and run flutter clean

    flutter pub get 
    
    flutter run 
    

    Congratulations! Your code error solved

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search