不知道在何处添加Pod文件(在ios上安装flutter)>

问题描述 投票:0回答:1
我正在开发一个带有Firebase后端的Flutter项目,并试图将我项目的ios方面添加到Firebase项目中。说明要添加以下豆荚:

# Add the Firebase pod for Google Analytics pod 'Firebase/Analytics' # Add the pods for any other Firebase products you want to use in your app # For example, to use Firebase Authentication and Cloud Firestore pod 'Firebase/Auth' pod 'Firebase/Firestore'

但是问题是我不知道将这些内容写在文件中的什么位置。这是位于此处的文件(ios / Podfile)。可以让更熟悉ios开发的人告诉我在哪里添加这些Pod吗?谢谢!

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

再次感谢!我也可能有另一个文件。他们是说Podfile.lock文件吗?

我正在开发一个带有Firebase后端的Flutter项目,并试图将我项目的ios方面添加到Firebase项目中。说明要添加以下Pod:#添加Firebase ...

ios firebase flutter cocoapods firebase-analytics
1个回答
0
投票
您想将这些行添加到'Podfile'文件,而不是Podfile.lock。您可以在行的开头或结尾添加行,但是将其添加到开头可能很好,因此您可以轻松查看默认文件的修改方式。
© www.soinside.com 2019 - 2024. All rights reserved.