skip to Main Content

After updating to the XCode 16 Beta, when building app i get this error (in attachments), thats basically it. Is there any way to fix that or should I wait for BoringSSL update?

I’ve tried pod update, changing Minimum Deployment version, it didnt helped.

2

Answers


  1.       '  # Uncomment this line to define a global platform for your project
      platform :ios, '16.0'
    
      # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
      ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
      project 'Runner', {
        'Debug' => :debug,
        'Profile' => :release,
        'Release' => :release,
      }
    
      def flutter_root
        generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
        unless File.exist?(generated_xcode_build_settings_path)
          raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
        end
    
        File.foreach(generated_xcode_build_settings_path) do |line|
          matches = line.match(/FLUTTER_ROOT=(.*)/)
          return matches[1].strip if matches
        end
        raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
      end
    
      require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
    
      flutter_ios_podfile_setup
    
      target 'Runner' do
        use_frameworks!
        use_modular_headers!
    
        flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
        target 'RunnerTests' do
          inherit! :search_paths
        end
      end
      
      post_install do |installer|
        installer.pods_project.targets.each do |target|
          target.build_configurations.each do |config|
            # Modify existing XCConfig settings
            xcconfig_path = config.base_configuration_reference.real_path
            xcconfig = File.read(xcconfig_path)
      
            # Replace DT_TOOLCHAIN_DIR with TOOLCHAIN_DIR
            xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
      
            # Remove the -G flag if it is specifically for BoringSSL-GRPC
            if target.name == 'BoringSSL-GRPC'
              xcconfig_mod.gsub!('-G', '')  # Removing the -G flag
            end
      
            # Write back the modified configuration
            File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
      
            # Additional build settings
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
            config.build_settings['EXCLUDED_ARCHS'] = 'arm64'  # Corrected the key name here
          end
        end
      
        # Apply additional Flutter-specific settings
        installer.pods_project.targets.each do |target|
          flutter_additional_ios_build_settings(target)
        end
      end
      
        '
    

    This solve my problem add this line to the Podfile : xcconfig_mod.gsub!('-G', '') # Removing the -G flag'

    And :
    In some cases, Xcode settings may need to be adjusted to allow non-modular includes in framework modules.

    Open Xcode and navigate to your project’s build settings.
    Search for "Allow Non-modular Includes in Framework Modules".
    Set this to Yes.

    Login or Signup to reply.
  2. If you are using Cocoapods this is a quick fix:

    Add this to you Podfile ->

    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
    

    This issue is from GRPC: https://github.com/grpc/grpc/pull/36904

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