Flutter.io(Dart)应用在iOS模拟器上无法启动

3
我有最新的OSX Sierra,最新的XCode和适用的插件,并且打开并准备好了iPhone 6模拟器。 我已按照 https://flutter.io/setup-macos/#ios-setup中的所有说明进行操作。 在终端中运行“Flutter run”时,应用程序无法安装到模拟器上,并显示以下错误消息: 无法为模拟器构建应用程序。在iPhone 6上启动应用程序时出错。 这是终端说的...
            Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install...                                8.5s
Running Xcode build...                               24.1s
Failed to build iOS app
Error output from Xcode build:
↳
    2017-11-22 13:13:38.122 xcodebuild[47659:25935636]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13510/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
    Details:  unexpected successful exit code from cancelled command <C0009:'CpResource app.flx':P12>
    Object:   <PBXTargetBuildContext: 0x7fccf1235200>
    Method:   -createCommandInvocationRecordFromInvocation:
    Thread:   <NSThread: 0x7fccf2847ea0>{number = 16, name = (null)}
    Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
    ** BUILD FAILED **
    
    
    The following build commands failed:
        CopyPlistFile /Users/deborah/Desktop/chq_emulator/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist Runner/GoogleService-Info.plist
    (1 failure)
Xcode's output:
↳
    Build settings from command line:
        ARCHS = x86_64
        BUILD_DIR = /Users/deborah/Desktop/chq_emulator/build/ios
        ONLY_ACTIVE_ARCH = YES
        SDKROOT = iphonesimulator11.1
    
    === CLEAN TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
    ... list of subsidiary infomation ...

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

还有其他人有关于如何在模拟器上启动Flutter的建议吗?


2
你试过启动Xcode吗?它经常在打开时加载额外的更新。这可能与问题无关,但这是一个相当普遍的问题。 - Günter Zöchbauer
谢谢你的建议 :)。这次虽然没有帮上忙。 - Deborah
请查看 https://dev59.com/LFUL5IYBdhLWcg3wd31x#54671608。这对我有用。 - MUHAMMED IQBAL PA
1个回答

0

首先尝试运行您的Xcode,并确保其已更新。在Xcode上打开{flutter_project}/ios构建,然后尝试从那里在模拟器上运行iOS项目。

如果仍然遇到问题,您可以在终端上运行此命令。这应该设置活动开发人员目录的路径。

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接