xcodebuild:警告:使用多个匹配目标中的第一个:

问题描述 投票:0回答:3

自从我迁移到空安全以来,我收到了此错误。 我做了一些研究并尝试了所提出的解决方案,但没有一个有效。在空安全之前,应用程序运行得非常好。我没有看到两者之间的联系。 请问您能给建议吗?

从昨天开始,我做了很多测试。

1/ 在迁移到空安全之前,我已经回到了我的代码。 (我遇到了同样的错误)。那么, 2/ 我已经删除了 Xcode 并重新安装了它。 3/我已经安装了VS,看看是否遇到同样的错误。 4/我还创建了一个新项目

但我仍然遇到同样的错误

下面,我添加了 podfile。

非常感谢。

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                           1820,8s
Failed to build iOS app
Error output from Xcode build:
↳
    --- xcodebuild: WARNING: Using the first of multiple matching destinations:
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
    { platform:iOS Simulator, id:A7827DDA-D57C-4C7D-AF29-D287404A098F, OS:15.2, name:iPad (9th generation) }
    { platform:iOS Simulator, id:655072F5-B78B-417A-A39A-E2EF5F367D1A, OS:15.2, name:iPad Air (4th generation) }
    { platform:iOS Simulator, id:0089D625-2CF5-4037-B54A-B302EBAC428A, OS:15.2, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:9D539B42-3FA0-40D0-B057-50E22BC1AAE1, OS:15.2, name:iPad Pro (11-inch) (3rd generation) }
    { platform:iOS Simulator, id:E59D0A6F-171D-440F-BB77-28FB1A7E28B4, OS:15.2, name:iPad Pro (12.9-inch) (5th generation) }
    { platform:iOS Simulator, id:E063D8D1-3B73-4E0A-BFD5-17F85D82387A, OS:15.2, name:iPad mini (6th generation) }
    { platform:iOS Simulator, id:EFA25E9A-ED6D-45C8-AC6C-E6F170897C35, OS:15.2, name:iPhone 8 }
    { platform:iOS Simulator, id:B5CE0C5D-F2CB-41DA-BAD4-7E89B1B6F77D, OS:15.2, name:iPhone 8 Plus }
    { platform:iOS Simulator, id:9217628D-E12D-4BFF-9B2C-AB8835B94445, OS:15.2, name:iPhone 11 }
    { platform:iOS Simulator, id:0BED3881-E61C-424C-A43B-3C9569D0397B, OS:15.2, name:iPhone 11 Pro }
    { platform:iOS Simulator, id:BB2713D1-33BF-451F-93C8-57ED8894D299, OS:15.2, name:iPhone 11 Pro Max }
    { platform:iOS Simulator, id:6E0A1CE0-AB51-4AC4-A584-90C26129193C, OS:15.2, name:iPhone 12 }
    { platform:iOS Simulator, id:830FB104-86CB-4779-9EB5-579C3746CA79, OS:15.2, name:iPhone 12 Pro }
    { platform:iOS Simulator, id:62CF789F-CE28-44C2-B715-E2BA9F7BD2CD, OS:15.2, name:iPhone 12 Pro Max }
    { platform:iOS Simulator, id:8D437B0A-B37D-4BDC-9A45-D78A9CA8A2A8, OS:15.2, name:iPhone 12 mini }
    { platform:iOS Simulator, id:C5939601-18C5-4190-9E3C-05D6CEF673E3, OS:15.2, name:iPhone 13 }
    { platform:iOS Simulator, id:F4087585-C491-4CA6-96D3-CBB37B42FEBF, OS:15.2, name:iPhone 13 Pro }
    { platform:iOS Simulator, id:412775AA-DBD1-459A-B95C-BF3279EE719D, OS:15.2, name:iPhone 13 Pro Max }
    { platform:iOS Simulator, id:1F57B67C-C80F-4E38-8F40-518D43ABF13D, OS:15.2, name:iPhone 13 mini }
    { platform:iOS Simulator, id:5B2AA7DD-EB1B-42D3-B818-D6C26533E9DD, OS:15.2, name:iPhone SE (2nd generation) }
    { platform:iOS Simulator, id:F0FA2173-CC30-4D40-B738-4FD16E29EBC8, OS:15.2, name:iPod touch (7th generation) }
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
    ** BUILD FAILED **

Error launching application on iPhone 12 Pro Max.

Pod文件

# Uncomment this line to define a global platform for your project
platform :ios, '10.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__))
end


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

    target.build_configurations.each do |config|
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'

      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',

        ## dart: PermissionGroup.microphone
        'PERMISSION_MICROPHONE=1',
      ]

    end
  end
end
flutter dart-null-safety
3个回答
2
投票

对于那些有同样问题的人。我已经尝试了互联网上找到的所有解决方案。 他们都没有工作。 我决定创建一个新项目,然后将我的 dart 文件一一复制到其中。 我已经重新导入了 pubspec 中的所有依赖项。 现在又恢复正常了。


0
投票

在 Xcode 中打开 xcworkspace 文件。打开登录和功能,然后选择“全部”,如果您在 Xcode 中添加了帐户并从 Xcode 构建一次,则选择自动签名


# Uncomment this line to define a global platform for your project
 platform :ios, '11.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__))
end

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

0
投票

我已经奋斗了一个星期,尝试了 Stack Overflow 上写的所有内容,但总是失败。我删除了 Xcode 应用程序并重新创建了它,我的项目成功了。

© www.soinside.com 2019 - 2024. All rights reserved.