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

efzxgjgh  于 5个月前  发布在  Flutter
关注(0)|答案(2)|浏览(122)

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

[!] 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.

 #  from /Users/tlobry/Desktop/Podfile:16
 #  -------------------------------------------
 #    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
 #  -------------------------------------------

字符串
这是我的pubspec.yaml:

name: flash_chat
description: A new Flutter application.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0<3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  animated_text_kit: ^4.1.1
  firebase_core: ^1.0.3
  firebase_auth: ^1.0.2
  cloud_firestore: ^1.0.4

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
  - images/


这是我的Podfile:

# Uncomment this line to define a global platform for your project
platform :ios, '9.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
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

wydwbb8l

wydwbb8l1#

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

rm Podfile.lock

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

u4dcyp6a

u4dcyp6a2#

你需要执行flutter pub get

相关问题