xcodebuild: WARNING: Using the first of multiple matching destinations:

Viewed 288

Since I have migrated to null safety I am getting this error. I have done some research and try the solutions proposed, but none of them are working. Before the null safety, the application was running perfectly fine. I do not see the link between the two. Please, can you advise?

Since yesterday, I have done a lot of test.

1/ I have gone back to my code, before the migration to null safety. (I am getting the same error). So then, 2/ I have removed Xcode and re-installed it. 3/ I have installed VS to see if I am getting the same error. 4/ I have also created a new project

But I am still getting the same error

Below, I have added the podfile.

Many thanks.

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.

PodFile

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

Open the xcworkspace file in Xcode. Open Signin and Capabilities then select "all" then select signing automatically if you have the account added in Xcode and build once from 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

For those who are having the same issue. I have tried all the solutions find on internet. None of them has worked. I have decided to create a new project and then to copy one by one my dart files into it. I have re-imported all my dependencies in pubspec. Now, it is working fine again.

Related