0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Xcode 15 flutter_inappwebview-Swift.h:286:9 Could not build module 'WebKit' Error

Posted at

・ Xcode15対応が4月25日から必須

4月25日より、Xcode 15への対応が必須となります。

Xcode 15でアプリをビルドした際にflutter_inappwebviewで以下のエラーが発生しました。解決方法を以下にご紹介します。

発生したエラー

flutter_inappwebview/flutter_inappwebview.framework/Headers/flutter_inappwebview-Swift.h:286:9 Could not build module 'WebKit'

解決策

Podfileの末尾に以下を追加することで、私の環境ではWebKitビルドエラーを解決します。

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|
          unless 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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?