简体   繁体   English

Flutter:iOS 在真实设备上测试不起作用,但只是白屏

[英]Flutter: iOS testing on Real Device does not work but just white screen

I am trying to run the app on my real device.我正在尝试在我的真实设备上运行该应用程序。 It used to work but then now, I have它曾经工作,但现在,我有

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

this errors and my iPhone has a white screen now.这个错误,我的 iPhone 现在有一个白屏。 Tried hot reload and hot restart .试过hot reloadhot restart Reinstalling the app and flutter clean.重新安装应用程序并清理 flutter。 I also looked up for the solution for com.apple.commcenter.coretelephony.xpc , but this is not working.我还查找了com.apple.commcenter.coretelephony.xpc的解决方案,但这不起作用。 However, the app runs totally fine on the iOS simulator.但是,该应用程序在 iOS 模拟器上运行良好。

Looks like you are trying to run your app directly from Xcode.看起来您正在尝试直接从 Xcode 运行您的应用程序。 That won't work and will result in a white screen.这将不起作用,并会导致白屏。

You should run your app on a real device the same way you run it on a simulator:您应该在真实设备上运行您的应用程序,就像在模拟器上运行它一样:

  1. Connect your device连接您的设备
  2. Open your project in VS Code在 VS Code 中打开你的项目
  3. Select your device in lower right corner Select 您的设备在右下角
  4. Run your app运行你的应用

You can also run your app from Terminal:您还可以从终端运行您的应用程序:

  1. cd into projects directory cd进入项目目录
  2. Run flutter run or flutter run --release运行flutter runflutter run --release

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM