ios 类型参数“nw_proxy_config_t”既不是C2C对象,也不是块类型

o8x7eapl  于 12个月前  发布在  iOS
关注(0)|答案(2)|浏览(153)

无法在最新的Xcode 15 Stable,iOS 17 stable上构建
关于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
lrpiutwd

lrpiutwd1#

修复:从主分支升级flutter,删除podfile.lock和安装pod
时间定位:

解决方法1来自GitHub:

使用sudo和你最喜欢的文本编辑器:

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

__IPHONE_OS_VERSION_MAX_ALLOWED从170000更改为180000

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=0\s*/, '')
          end
        end
      end
    end
  end
  project.save()
end

解决方法3更新

CocoaPods

gem install cocoapods

然后运行:

flutter clean 

flutter upgrade

cd ios && pod repo update

flutter run

而且项目建设必须没有问题

t5fffqht

t5fffqht2#

更新 flutter_inappwebview 到5.8.0适合我。

相关问题