首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Podfile和Firebase

Podfile和Firebase
EN

Stack Overflow用户
提问于 2018-10-16 03:57:29
回答 1查看 1.2K关注 0票数 0

在Podfile中应该将pod 'Firebase/Core'放在哪里?很明显,当Podfile如下所示时:

代码语言:javascript
复制
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!
  # Pods for Runner
  pod 'MaterialControls', '~> 1.2.2'
end

但是,我的项目的默认Podfile如下所示:

代码语言:javascript
复制
# 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'

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 packages 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

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

而且,无可否认,我不能完全破解它,以确定放置它的位置。它会直接进入target 'Runner' do块中use_frameworks!之后吗?或者是在ENV['COCOAPODS_DISABLE_STATS'] = 'true'之后文件的顶部?如有任何指导,将不胜感激。此外,如果您能够了解代码本身,这将是一个值得欢迎的奖励。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-16 04:56:17

use_frameworks!下面添加,然后安装吊舱。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52827767

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档