flutter 无法加载目标“arm 64-apple-ios10.0”的标准库

csbfibhn  于 2023-04-22  发布在  Flutter
关注(0)|答案(2)|浏览(132)

我已经为Andriod构建并运行了我的Flutter应用程序。但是当我第一次尝试为Mac构建它时,它显示了以下错误。
我是mac env的新手。我需要在Xcode中做一些更改吗?我的Xcode版本:Version 13.2.1 .但如果我在我的MAC使用VS代码它的运行良好和良好的一个新的Flutter项目.我必须运行我的iOS extingFlutter应用程序.帮助我实现这一iOS.

Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
Xcode build done.                                            9.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Command CompileSwiftSources failed with a nonzero exit code
    <unknown>:0: error: unable to load standard library for target 'arm64-apple-ios10.0'
/Users/sambitdas/Development/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.7/ios/Classes/RazorpayDelegate.swift:2:8: error: module compiled with Swift 5.5.1 cannot be imported by the Swift 5.5.2 compiler: /Users/sambitdas/sleepKart/sleepkart/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/arm64.swiftmodule
    import Razorpay
           ^
    <unknown>:0: error: unable to load standard library for target 'arm64-apple-ios10.0'
/Users/sambitdas/Development/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.7/ios/Classes/RazorpayDelegate.swift:2:8: error: module compiled with Swift 5.5.1 cannot be imported by the Swift 5.5.2 compiler: /Users/sambitdas/sleepKart/sleepkart/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/arm64.swiftmodule
    import Razorpay
           ^
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
Could not build the application for the simulator.
Error launching application on iPhone 13.
Exited (sigterm)
j8ag8udp

j8ag8udp1#

在podfile替换post_install下面的代码是为我工作

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['ENABLE_BITCODE'] = 'YES'
        config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end
3zwjbxry

3zwjbxry2#

使用terminal,试试这个:

cd ios

arch -x86_64 pod install

相关问题