ios Flutter Podfile问题

rwqw0loc  于 12个月前  发布在  iOS
关注(0)|答案(1)|浏览(147)

最近我更新了Xcode 15和IOS 17,我在Xcode中遇到了错误“DT_TOOLCHAIN_CHAIN”和代码签名问题。
我需要合并这两个到我的post_install部分,但每次我把它们放在一起,我会遇到'Flutter/Flutter. h'文件找不到
我是Podfile的新手,不知道如何调试,我将如何合并这两段代码?

post_install do |installer|
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
      xcconfig_path = config.base_configuration_reference.real_path
      xcconfig = File.read(xcconfig_path)
      xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
      File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
      end
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
     end
  end
end

字符串

7bsow1i6

7bsow1i61#

post_install do |installer|
  installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
      target.build_configurations.each do |config|
        xcconfig_path = config.base_configuration_reference.real_path
        xcconfig = File.read(xcconfig_path)
        xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
        File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
      end
  end
end

字符串

flutter clean


转到ios文件夹

cd ios


删除Podfile.lock

rm Podfile.lock


也删除Pods文件夹

rm -rf Pods/


安装软件包

flutter pub get


安装pod

pod install

相关问题