sam*_*sam 51 xcode ios flutter
升级 Xcode 15 beta 5 后,无法构建项目。
显示错误
Firebase 1 问题 DT_TOOLCHAIN_DIR 无法用于评估 LIBRARY_SEARCH_PATHS,请改用 TOOLCHAIN_DIR
FirebaseAnalytics 1 问题 DT_TOOLCHAIN_DIR 无法用于评估 LIBRARY_SEARCH_PATHS,请改用 TOOLCHAIN_DIR
尝试分解、重新安装和更新 Pod,问题并未解决。
颤振V.3.10.6
有什么办法可以解决这个问题吗?
Kyl*_*enn 61
下面的解决方案应该处理以下所有问题
'Flutter/Flutter.h' file not found(对我来说这与口味有关)Cycle inside Runner; building could produce unreliable results.(对我来说,这来自实时活动和小部件扩展)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
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
Run Code Online (Sandbox Code Playgroud)
如果这不起作用,请检查https://developer.apple.com/forums/thread/730974以获取更多想法。
flutter clean
flutter pub get
cd ios && rm podfile.lock && arch -x86_64 pod install --repo-update
Run Code Online (Sandbox Code Playgroud)
注意:此问题在最新的cocaopod 版本中已得到解决。
lar*_*rva 41
Xcode 15 似乎是旧 Cocoapods 版本的问题。此问题在 CocoaPods 版本1.13.0中已解决,
使用 Cocoapods 旧版本,您可以通过编辑 Podfile 来解决此问题,如下所示
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
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
xcconfig_path = config.base_configuration_reference.real_path
IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
Mec*_*cki 19
在发布修复程序之前,只需打开终端窗口并从项目文件夹运行以下命令:
find . -name "*.xcconfig" -type f -exec grep -l 'DT_TOOLCHAIN_DIR' {} \; \
| while IFS= read -r file; do sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$file"; done
Run Code Online (Sandbox Code Playgroud)
之后,错误消失并且不会返回,除非您再次运行pod update或pod install,在这种情况下,您必须再次运行该命令。
小智 8
我通过以下方式解决了这些问题:
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
Run Code Online (Sandbox Code Playgroud)
如果您使用inAppWebview进行 flutter,则会出现如下错误:
解析问题(Xcode):无法构建模块“WebKit”
因此,您可以在 pubspec.yaml 文件中添加如下内容:
flutter_inappwebview:
git:
url: https://github.com/Estrelio/flutter_inappwebview.git
ref: fix-xcode-17
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26350 次 |
| 最近记录: |