flutter 我无法让我的模拟器工作:运行pod安装时出错

gk7wooem  于 2023-05-19  发布在  Flutter
关注(0)|答案(1)|浏览(291)

当我尝试在iPhone 14 Pro Max模拟器上运行Flutter应用程序时,我收到以下错误消息:

CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    [!] Unable to find a target named `RunnerTests` in project `Runner.xcodeproj`, did find `Runner`.

   
Error running pod install
Error launching application on iPhone 14 Pro Max.

我的Podfile看起来像这样:

platform :ios, '13.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 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

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

我怀疑我的Podfile有问题,我应该提到我有一个M1处理器。有人能帮我吗?

13z8s7eq

13z8s7eq1#

我去掉了

target 'RunnerTests' do
    inherit! :search_paths
  end

我就能运行这个应用了看起来RunnerTests是用于单元测试或集成测试的,必须单独设置。

相关问题