与 Flutter 3 相关的 Xcode 15 问题 — 修复

大家好,您可能已经更新到最新版本的 mac OS Sonoma,这会强制更新 Xcode。你不是世界上唯一热情的人,我们都对此感到内疚。

但这次更新带来了很多不必要的 bug,给 Flutter 开发者带来了很多恐慌和不眠之夜。

在这篇短文中,我将列出每个 Flutter 应用程序开发人员在更新到最新版本的应用程序后都会遇到的两个常见错误。

错误1

文件夹名称更改问题

在这里插入图片描述
当您在最新版本的 Xcode 中运行 Flutter 应用程序时,这个问题将是第一个弹出的问题。

使固定

为了解决这个问题,您可以手动搜索该文件夹并将所有实例替换为TOOLCHAIN_DIR,或者您可以编写一个 pod 脚本以在每次安装 pod 时自动进行更改。


post_install do |installer|
  installer.aggregate_targets.each do |target|
      target.xcconfigs.each do |variant, xcconfig|
      xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
      IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
      end
  end

 .......
 end
    installer.pods_project.targets.each do |target|
  

猜你喜欢

转载自blog.csdn.net/iCloudEnd/article/details/133482978
今日推荐