Windows环境执行pod install报错:命令语法错误与Podfile路径异常求助
Windows环境执行pod install报错:命令语法错误与Podfile路径异常求助
各位好,最近在折腾Flutter iOS项目的依赖安装时遇到了一个棘手的问题,想请教下社区的朋友们。
我在Windows终端执行pod install命令时,直接报了语法错误,同时还伴随Podfile的软链接路径异常,具体错误日志如下:
PS D:\Code\Dart\ao3_reader\ios> pod install The syntax of the command is incorrect. [!] Invalid `Podfile` file: No such file or directory @ rb_file_s_symlink - (C:\\Users\\USER\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\audio_service-0.18.18\\, D:/Code/Dart/PROJECT/ios/.symlinks/plugins/audio_service). # from D:/Code/Dart/PROJECT/ios/Podfile:36 # ------------------------------------------- # end # > end # # Uncomment the next line to define a global platform for your project # -------------------------------------------
我现在完全摸不着头脑:CocoaPods官方文档里明确写着pod install就是标准用法,怎么会说命令语法不对呢?更奇怪的是,我在Codemagic的Mac虚拟机上运行同一个命令完全正常,但在自己的Windows本地机器上就死活跑不通。
有没有朋友遇到过类似的情况?或者知道可能的原因是什么?麻烦指点一下,非常感谢!
附上我的Podfile内容供参考:
# Uncomment the next line to define a global platform for your project platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do # Comment the next line if you don't want to use dynamic frameworks # use_frameworks! use_frameworks! :linkage => :static # use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) # Pods for Runner pod 'GoogleMobileAdsMediationFacebook' end post_install do |installer| 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'] = '12.0' end end end
内容来源于stack exchange
相关产品推荐
相关产品推荐

