【问题标题】:Flutter: iOS testing on Real Device does not work but just white screenFlutter:Real Device 上的 iOS 测试不起作用,只是白屏
【发布时间】:2020-12-26 14:12:55
【问题描述】:

我正在尝试在我的真实设备上运行该应用程序。它曾经工作,但现在,我有

2020-12-26 23:06:16.907475+0900 Runner[4072:1164380] <Warning>: Please set a value for FacebookAutoLogAppEventsEnabled. Set the flag to TRUE if you want to collect app install, app launch and in-app purchase events automatically. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#disable-auto-events.
2020-12-26 23:06:16.907988+0900 Runner[4072:1164380] <Warning>: You haven't set a value for FacebookAdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#disable-auto-events.
2020-12-26 23:06:17.321827+0900 Runner[4072:1164380] Metal GPU Frame Capture Enabled
2020-12-26 23:06:17.322129+0900 Runner[4072:1164380] Metal API Validation Enabled
2020-12-26 23:06:17.496370+0900 Runner[4072:1164380] FBSDKLog: Unable to obtain a key window, marking <UIWindow: 0x108853370; frame = (0 0; 375 812); hidden = YES; gestureRecognizers = <NSArray: 0x2824c0ba0>; layer = <UIWindowLayer: 0x282a1dd60>> as keyWindow
2020-12-26 23:06:17.717583+0900 Runner[4072:1164625] flutter: Observatory listening on http://127.0.0.1:49340/oBpPo-aZas0=/
2020-12-26 23:06:18.294210+0900 Runner[4072:1164608] [Client] Updating selectors after delegate removal failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 92 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service on pid 92 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
2020-12-26 23:06:18.300527+0900 Runner[4072:1164609] [tcp] tcp_input [C2.1:3] flags=[R] seq=883740456, ack=0, win=0 state=CLOSED rcv_nxt=883740456, snd_una=4000769170
2020-12-26 23:06:18.305294+0900 Runner[4072:1164609] [tcp] tcp_input [C2.1:3] flags=[R] seq=883740456, ack=0, win=0 state=CLOSED rcv_nxt=883740456, snd_una=4000769170
2020-12-26 23:06:18.305448+0900 Runner[4072:1164609] [tcp] tcp_input [C2.1:3] flags=[R] seq=883740456, ack=0, win=0 state=CLOSED rcv_nxt=883740456, snd_una=4000769170
2020-12-26 23:06:18.323253+0900 Runner[4072:1164380] FBSDKLog: starting with Graph API v2.4, GET requests for /2801278236811751/model_asset should contain an explicit "fields" parameter
2020-12-26 23:06:18.329438+0900 Runner[4072:1164596] [tcp] tcp_input [C1.1:3] flags=[R] seq=3880368660, ack=0, win=0 state=CLOSED rcv_nxt=3880368660, snd_una=3336524019
2020-12-26 23:06:18.329608+0900 Runner[4072:1164596] [tcp] tcp_input [C1.1:3] flags=[R] seq=3880368660, ack=0, win=0 state=CLOSED rcv_nxt=3880368660, snd_una=3336524019
2020-12-26 23:06:18.528960+0900 Runner[4072:1164609] [tcp] tcp_input [C4.1:3] flags=[R] seq=4057472013, ack=0, win=0 state=CLOSED rcv_nxt=4057472013, snd_una=3065118857
2020-12-26 23:06:18.529027+0900 Runner[4072:1164609] [tcp] tcp_input [C4.1:3] flags=[R] seq=4057472013, ack=0, win=0 state=CLOSED rcv_nxt=4057472013, snd_una=3065118857
2020-12-26 23:06:18.615382+0900 Runner[4072:1164608] [tcp] tcp_input [C3.1:3] flags=[R] seq=2547416679, ack=0, win=0 state=CLOSED rcv_nxt=2547416679, snd_una=2190598588
2020-12-26 23:06:18.615488+0900 Runner[4072:1164608] [tcp] tcp_input [C3.1:3] flags=[R] seq=2547416679, ack=0, win=0 state=CLOSED rcv_nxt=2547416679, snd_una=2190598588

这个错误,我的 iPhone 现在有一个白屏。试过hot reloadhot restart。重新安装应用程序并清理干净。我还查找了com.apple.commcenter.coretelephony.xpc 的解决方案,但这不起作用。但是,该应用在 iOS 模拟器上运行良好。

【问题讨论】:

    标签: ios flutter


    【解决方案1】:

    看起来您正试图直接从 Xcode 运行您的应用程序。这不起作用,会导致白屏。

    您应该像在模拟器上运行一样在真实设备上运行您的应用:

    1. 连接您的设备
    2. 在 VS Code 中打开您的项目
    3. 在右下角选择您的设备
    4. 运行您的应用程序

    您也可以从终端运行您的应用程序:

    1. cd 进入项目目录
    2. 运行flutter runflutter run --release

    【讨论】:

    • 我在终端上做到了。我得到了白屏。而且,这就是我继续使用 XCode 检查错误的原因:/
    猜你喜欢
    • 2020-07-11
    • 2018-02-05
    • 1970-01-01
    • 1970-01-01
    • 2018-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多