【问题标题】:Problems trying to build flutter app for iOS尝试为 iOS 构建颤振应用程序时遇到的问题
【发布时间】:2020-08-12 08:05:43
【问题描述】:

我正在开发一个项目,我试图在 Xcode 的 iOS 模拟器上构建,但由于大量我不太了解的错误,构建一直失败。

如果有人有时间,请寻求指导和帮助。

谢谢

Xcode build done.                                           11.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Command CompileSwift failed with a nonzero exit code
    Command CompileSwift failed with a nonzero exit code
    /Users/chris/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/screenshot_callback-1.1.1/ios/Classes/SwiftScreenshotCallbackPlugin.swift:27:34: error: 'userDidTakeScreenshotNotification' has been renamed to 'NSNotification.Name.UIApplicationUserDidTakeScreenshot'
              forName: UIApplication.userDidTakeScreenshotNotification,
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     NSNotification.Name.UIApplicationUserDidTakeScreenshot
    UIKit.UIApplication:73:22: note: 'userDidTakeScreenshotNotification' was introduced in Swift 4.2
        public class let userDidTakeScreenshotNotification: NSNotification.Name
                         ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'camera' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'camera' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).
Exited (sigterm)```


【问题讨论】:

    标签: ios xcode flutter dart


    【解决方案1】:

    在项目的 ios / 文件夹中尝试此命令

    pod install
    

    如果已经安装,请使用

    pod update
    

    如果您使用任何相机插件或 image_picker,请告诉我

    【讨论】:

    • 我安装了 pod 并收到 2 个警报...其中一个说“自动分配平台 iOS 和版本 11.0 到目标 Runner,因为没有指定平台。”另一个说法是“CocoaPods 没有设置您项目的基本配置,因为您的项目已经有一个自定义配置集。为了让 CocoaPods 集成工作,请将目标 Runner 的基本配置设置为 Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig或者在你的构建配置中包含Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig......"
    • 好的,这也在我的项目中。您是通过工作空间还是项目构建?
    猜你喜欢
    • 2021-06-14
    • 2023-03-23
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    • 2020-06-13
    • 1970-01-01
    • 1970-01-01
    • 2021-10-14
    相关资源
    最近更新 更多