LIBRARY_SEARCH_PATHS、LD_RUNPATH_SEARCH_PATHS等等
在Podfile
文件内修改
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
# 此处之后都为修改的内容
targets = installer.pods_project.targets
targets.each do |target|
target.build_configurations.each do |config|
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
# 此处为修改 LD_RUNPATH_SEARCH_PATHS 和 DT_TOOLCHAIN_DIR
xcconfig_mod = xcconfig.gsub(/(LD_RUNPATH_SEARCH_PATHS|DT_TOOLCHAIN_DIR)/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") do |file|
file << xcconfig_mod
end
end
end
end
如果是插件内出现,则需要在主项目内也需要添加该段
参考链接
https://github.com/flutter/flutter/issues/131527