【问题标题】:'cloud_firestore' not found未找到“cloud_firestore”
【发布时间】:2021-12-03 17:22:06
【问题描述】:

我相信我之前也遇到过这个问题,通过将我的 Podfile 更改为这个解决了它:

(iOS 在 xcode 中也是一样的,如果相关的话)

platform :ios, '12.0'

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

def flutter_install_ios_plugin_pods(ios_application_path = nil)
  ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)
  raise 'Could not find iOS application path' unless ios_application_path

  symlink_dir = File.expand_path('.symlinks', ios_application_path)
  system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.

  symlink_plugins_dir = File.expand_path('plugins', symlink_dir)
  system('mkdir', '-p', symlink_plugins_dir)

  plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies')
  plugin_pods = flutter_parse_plugins_file(plugins_file)
  plugin_pods.each do |plugin_hash|
    plugin_name = plugin_hash['name']
    plugin_path = plugin_hash['path']
    if (plugin_name && plugin_path)
      symlink = File.join(symlink_plugins_dir, plugin_name)
      File.symlink(plugin_path, symlink)

      if plugin_name == 'flutter_ffmpeg'
          pod 'flutter_ffmpeg/full-lts', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
      else
          pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
      end
    end
  end
end

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

然后跑了pod install

这是我的 GoogleServices-info.plist 文件所在的位置:

我做了 pub upgrade 和 pub get

我还删除了 Podfile.lock 并运行 pod install

我需要更改 Podfile 中的某些内容吗?还是其他地方的问题?

在我对我的 android 文件夹/gradle 文件进行更改之前,它正在工作。会不会影响到它?

【问题讨论】:

    标签: flutter dart google-cloud-firestore


    【解决方案1】:

    从这里关注Flutter module not found in Xcode的答案

    1.- 删除 Podfile

    在 Android Studio 中:

    2.- 颤振干净

    3.- 颤振 pub 获取

    4.- cd ios

    5.- 吊舱安装

    然后

    6.- 通过 Xcode 构建和运行您的应用

    在那之后对我不起作用,在 Xcode 中我转到 Product -> Scheme -> Edit Scheme 并在 Build Option 旁边检查了 Find Implicit Dependencies。现在工作正常。不得不让它在 android studio 中检查它运行它的过程,现在它在没有它检查的情况下工作。

    【讨论】:

      猜你喜欢
      • 2021-06-29
      • 2020-10-02
      • 2020-10-06
      • 2019-05-24
      • 2021-01-08
      • 2021-07-21
      • 2021-09-26
      • 2021-01-29
      • 2021-08-17
      相关资源
      最近更新 更多