ios - 无法加载目标 'arm64-apple-ios10.0' 的标准库

标签 ios xcode flutter razorpay flutter-razorpay

我已经为 Andriod 构建并运行了我的 flutter 应用程序。但是当我第一次尝试为 Mac 构建它时,它显示以下错误。

我是 mac 环境的新手。我需要在 Xcode 中进行一些更改吗? 我的 Xcode 版本:版本 13.2.1。 但是如果我使用 VS CODE 在我的 MAC 中创建一个新的 flutter 项目,它运行得很好。我必须运行适用于 ios 的 exting flutter 应用程序。帮助我在 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)

最佳答案

在 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

关于ios - 无法加载目标 'arm64-apple-ios10.0' 的标准库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70484947/

相关文章:

dart - 如何在 BottomNavigationBarItem 中绝对定位徽章

proxy - 企业防火墙后面的 Flutter 应用程序在获取包期间引发 TLS 错误

ios - UISwitch 正在触发 UITableView 中的另一个 UISwitch 事件

ios - 添加手势识别器以指定表格中单元格的对象

javascript - 自定义 React Native UI 组件 : Invariant Violation

ios - 在一定范围内在舞台上添加敌人

iphone - 如何在没有 UIimagePickerController 的情况下以编程方式在 iphone 中访问保存图像中的图像?

c++ - clang : error: cannot specify both '-fobjc-arc' and '-fobjc-gc' in Xcode 4. 6.3

objective-c - Xcode 项目比较工具

flutter - 如何使这种设计 flutter 朔迷离?