skip to Main Content

Cannot build on latest Xcode 15 Stable, iOS 17 stable

Related to
https://github.com/pichillilorenzo/flutter_inappwebview/issues/1735

flutter run

Could not build the precompiled application for the device.
Error (Xcode): type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h:119:46

Parse Issue (Xcode): Could not build module 'WebKit'
/build/ios/Debug-iphoneos/flutter_inappwebview/flutter_inappwebview.framework/Headers/flutter_inappwebview-Swift.h:285:8


Error launching application on iPhone 

2

Answers


  1. Chosen as BEST ANSWER

    Fix: Upgrade flutter from master branch , delete podfile.lock and re run pod install

    Temporal fix:

    Workaround 1 from GitHub:

    Use sudo and yor favorite text editor:

    open /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h,
    

    change the __IPHONE_OS_VERSION_MAX_ALLOWED from 170000 to 180000

    Workaround 2:

    post_integrate do |installer|
      compiler_flags_key = 'COMPILER_FLAGS'
      project_path = 'Pods/Pods.xcodeproj'
    
      project = Xcodeproj::Project.open(project_path)
      project.targets.each do |target|
        target.build_phases.each do |build_phase|
          if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase)
            build_phase.files.each do |file|
              if !file.settings.nil? && file.settings.key?(compiler_flags_key)
                compiler_flags = file.settings[compiler_flags_key]
                file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0s*/, '')
              end
            end
          end
        end
      end
      project.save()
    end
    
    

    Workaround 3 update

    CocoaPods

    gem install cocoapods

    and run :

    flutter clean

    flutter upgrade

    cd ios && pod repo update

    flutter run

    And the project must build without problems


  2. Team,

    I am facing the same issue. Tried all the solutions, does not work

    1. changes in Podfile – does not work
    2. Editing the file – I am not able to save (tried with vim, nano, vscode xcode)

    Is there anything else that can be done

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