Swift编译器错误(Xcode):并发仅在iOS 15.0.0或更高版本中可用

wswtfjt7  于 2022-12-21  发布在  Swift
关注(0)|答案(1)|浏览(654)

我试图在iOS上运行我的Flutter应用程序,其中使用FireBase和谷歌Map也做了所有与此相关的设置,但仍然,当我在iOS上运行它时,我得到以下错误。

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:223:28

这是我的播客文件

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

而完整的错误看起来像这样

Failed to build iOS app
Error output from Xcode build:
↳
    objc[8137]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x2012f7620) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x104524598). One of the two will be used. Which one is undefined.
    objc[8137]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x2012f7670) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1045245e8). One of the two will be used. Which one is undefined.

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/8r/j5l1hdxj23n759qd_g_kkfk40000gn/T/flutter_tools.eZhoD4/flutter_ios_build_temp_dirw4qaeH/temporary_xcresult_bundle

    /Users/rashidali/FlutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:50:35: warning: 'subscriberCellularProvider' is deprecated: first deprecated in iOS 12.0 [-Wdeprecated-declarations]
        CTCarrier *carrier = [netInfo subscriberCellularProvider];
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                      serviceSubscriberCellularProviders
    In module 'CoreTelephony' imported from /Users/rashidali/FlutterSdk/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: property 'subscriberCellularProvider' is declared deprecated here
    @property(readonly, retain, nullable) CTCarrier *subscriberCellularProvider API_DEPRECATED_WITH_REPLACEMENT("serviceSubscriberCellularProviders", ios(4.0, 12.0)) API_UNAVAILABLE(macos);

Result bundle written to path:
        /var/folders/8r/j5l1hdxj23n759qd_g_kkfk40000gn/T/flutter_tools.eZhoD4/flutter_ios_build_temp_dirw4qaeH/temporary_xcresult_bundle

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:223:28

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:292:24

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:376:28

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:406:58

Swift Compiler Error (Xcode): Concurrency is only available in iOS 15.0.0 or newer
/Users/rashidali/LubanPoint/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/StorageReference.swift:440:23

Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code

Could not build the application for the simulator.
Error launching application on iPhone 13.

请提供解决方案,如何解决它.

cpjpxq1n

cpjpxq1n1#

您的目标是iOS 11,我们可以在您的播客文件中看到:

platform :ios, '11.0'

如果你想使用并发、async/await调用,你需要按照编译器的建议将其更改为iOS 15。还要确保有XCode 13.2或更高版本。

相关问题