找不到CloudFirestorePlugin文件

时间:2019-12-01 23:05:20

标签: xcode flutter

运行“ flutter build iOS”时遇到以下问题:

'cloud_firestore/CloudFirestorePlugin.h' file not found #import <cloud_firestore/CloudFirestorePlugin.h>`

App与我的iPhone和虚拟iPhone完美配合

最新版本的cocopod

xcode :11.2.1

软件包:cloud_firestore:^ 0.12.10 + 2 //最新版本

podFile

platform :ios, '13.1'

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  use_frameworks!

  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

PS。删除了注释行以缩短代码。

有人知道这个任务有什么问题吗?

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误。

尝试以下为我解决的问题:

在Xcode中,转到“文件”>“工作区设置”,然后选择“ 旧版构建系统”

在我的Podfile中-我有platform :ios, '9.0'不确定您是否需要此文件,但仅供参考,因为我看到的版本是13.1

如果使用VS Code,则可能还需要从pod install目录中的命令行运行<your_project_name/ios(因为VS Code无法正确运行/完成Pod安装; VS Code版本1.40。 2)

仅需注意:我还发现了最初的构建->在模拟器上启动,花了很长时间。我使用的是2012 Macbook Pro,这是有原因的,但仅供参考。最终它确实在模拟器上启动,并且在热加载后效果很好