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
本文介绍了如何在Flutter项目中,特别是在插件开发时,如何修改Podfile中的LD_RUNPATH_SEARCH_PATHS和DT_TOOLCHAIN_DIR设置,以确保正确链接和构建。如果在插件中遇到`ffi`问题,可能需要在主项目中同步添加这部分配置。

2809

被折叠的 条评论
为什么被折叠?



