“ Firebase.xcconfig”的文件参考是多个组的成员(“支持文件”和“支持文件”);这表明项目格式错误

时间:2019-07-24 19:55:03

标签: ios firebase flutter

我遇到了这个问题,找不到与之相关的更多信息。 整个消息说:

  

xcodebuild [41239:2858194]警告:的文件参考   “ Firebase.xcconfig”是多个组的成员(“支持文件”   和“支持文件”);这表示项目格式不正确。只有   其中一个组的成员资格将保留(但   目标不会受到影响)。如果要引用相同的文件   在多个组中,请为同一路径添加另一个引用。

到目前为止,我已经尝试过:

  • 干净的Pod缓存
  • 删除Podfile.lock
  • 删除〜/ Library / Developer / Xcode / DerivedData / *
  • 解开吊舱
  • 删除〜/ Library / Caches / CocoaPods
  • 干净整洁

什么都没有改变。问题仍然存在。

我的Podfile是:

# Uncomment this line to define a global platform for your project

platform :ios, '9.0'
use_modular_headers!

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
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!
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  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
  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

# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
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

有人可以帮我吗?

PD。我有这个警告:

  

/Users/some/path/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+6/ios/Classes/FirebaseCorePlugin.m:8:9:   严重错误:找不到“ Firebase / Firebase.h”文件       #进口               ^ ~~~~~~~~~~~~~~~~~~~~       产生1个错误。       注意:使用新的构建系统注释:规划构建注释:构建构建说明

...还有这个:

  

此iPhone 7(型号1660、1778、1779、1780)正在运行iOS 12.4   (16G77),此版本的Xcode可能不支持。

但是,由于我使用的是iPhone模拟器,而不是真正的设备,所以最后一个与我无关。

编辑:一些其他信息可能会有所帮助。 当我运行pod update时,我得到以下信息: 下载依赖项

  

安装Firebase 2.5.1
  安装Firebase 6.5.0(原为2.5.1)

显然已经安装了两个版本的Firebase,但是我不知道为什么会这样。 我的pubspec.yaml依赖项是:

dependencies:

  firebase_core: ^0.4.0+6

  firebase_auth: ^0.11.1+10

  firebase_database: ^3.0.4

  http: ^0.12.0+2

  google_sign_in: ^4.0.4

  provider: ^3.0.0+1

  flutter_geofire: ^0.0.4

  google_maps_flutter: ^0.5.19+2

  location: ^2.3.5

2 个答案:

答案 0 :(得分:0)

这也许可以解决您的问题:

转到ios /文件夹 运行:

pod outdated
pod update

答案 1 :(得分:0)

  1. 转到您的iOS / .symlinks文件夹并删除firebase插件(可能不存在)
  2. 干净整洁
  3. 备份您的Podfile
  4. 删除Podfile.lock
  5. 删除Pods文件夹
  6. 删除Podfile
  7. 在终端中:pod init(在iOS文件夹中)
  8. 在终端中:pod安装
  9. 从备份中复制您的podfile内容
  10. 在终端中:pod init
  11. 在终端中:pod安装
  12. 在终端中:快速运行或仅快速构建iOS(使用cd到pubspec.yaml)