Pod无法更新或安装- dart /Flutter

efzxgjgh  于 2024-01-04  发布在  Flutter
关注(0)|答案(2)|浏览(288)

我想实现firebase,为此我必须更新pod。然而,当我在控制台中输入pod repo update时,它什么也不做.它只是显示我的“Updating spec repo 'trunk'”,然后它显示我的提示。如果我在控制台中输入pod install,它会显示:

  1. [!] Invalid `Podfile` file: /Users/tlobry/Desktop/Flutter/Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.
  2. # from /Users/tlobry/Desktop/Podfile:16
  3. # -------------------------------------------
  4. # unless File.exist?(generated_xcode_build_settings_path)
  5. > raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  6. # end
  7. # -------------------------------------------

字符串
这是我的pubspec.yaml:

  1. name: flash_chat
  2. description: A new Flutter application.
  3. version: 1.0.0+1
  4. environment:
  5. sdk: ">=2.1.0<3.0.0"
  6. dependencies:
  7. flutter:
  8. sdk: flutter
  9. cupertino_icons: ^0.1.2
  10. animated_text_kit: ^4.1.1
  11. firebase_core: ^1.0.3
  12. firebase_auth: ^1.0.2
  13. cloud_firestore: ^1.0.4
  14. dev_dependencies:
  15. flutter_test:
  16. sdk: flutter
  17. flutter:
  18. uses-material-design: true
  19. assets:
  20. - images/


这是我的Podfile:

  1. # Uncomment this line to define a global platform for your project
  2. platform :ios, '9.0'
  3. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  4. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  5. project 'Runner', {
  6. 'Debug' => :debug,
  7. 'Profile' => :release,
  8. 'Release' => :release,
  9. }
  10. def flutter_root
  11. generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  12. unless File.exist?(generated_xcode_build_settings_path)
  13. raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  14. end
  15. File.foreach(generated_xcode_build_settings_path) do |line|
  16. matches = line.match(/FLUTTER_ROOT\=(.*)/)
  17. return matches[1].strip if matches
  18. end
  19. raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
  20. end
  21. require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
  22. flutter_ios_podfile_setup
  23. target 'Runner' do
  24. use_frameworks!
  25. use_modular_headers!
  26. flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  27. end
  28. post_install do |installer|
  29. installer.pods_project.targets.each do |target|
  30. flutter_additional_ios_build_settings(target)
  31. end
  32. end

wydwbb8l

wydwbb8l1#

这是我过去尝试修复Pod安装问题的方法:
从ios文件夹中删除podfile.lock

  1. rm Podfile.lock

字符串
再次运行pod install
您也可以尝试将您的Podfile更改为platform:ios,'10.0'

u4dcyp6a

u4dcyp6a2#

你需要执行flutter pub get

相关问题