iOS Xcode 10的Flutter构建失败

问题描述 投票:0回答:3

我将Flutter升级到最新版。以下是医生的输出

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.14 18A326h, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.27.1)

当我使用目标到iOS模拟器运行应用程序时,我得到了这个

Launching lib/main.dart on iPhone XS Max in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    error: Multiple commands produce '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
    1) Target 'Runner' has copy command from '/Users/kalehv/dev/todo/todo-flutter/ios/Flutter/Flutter.framework' to '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
    2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
    warning: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner')
    warning: ignoring duplicated output file: '/Users/kalehv/dev/todo/todo-flutter/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
    note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone XS Max.
ios flutter xcode10
3个回答
4
投票

我认为这有助于至少它对我有用url

打开你的Xcode,在Apple图标旁边有左上角的File,然后打开Workspace Settings并将构建系统更改为Legacy Build System


0
投票

我有同样的问题,但当我改为Legacy Build System时,我得到了大量的Apple Mach-O Linker Error

我最终将问题缩小到Runner.xcodeproj/project.pbxproj中的设置(可以在Runner - > Build settings选项卡中从XCode操作)。

我以某种方式设定了

Build active architecture only
           - Debug                   No
           - Profile                 Yes
           - Release                 Yes

把它改成

Build active architecture only
           - Debug                   Yes
           - Profile                 Yes
           - Release                 Yes

解决了错误。


0
投票

我通过在ios文件夹中的Podfile中取消提交平台目标来修复此问题,因此它将是9.然后您必须将平台目标从Xcode更改为9这非常重要。在此之后执行此操作打开您的Xcode并在Apple图标旁边的左上角有File,然后打开工作区设置并将构建系统更改为Legacy Build System

然后在link发布这个帖子

点击Xcode中的clean按钮项目并运行它。

我希望这能帮到您。

© www.soinside.com 2019 - 2024. All rights reserved.