Flutter run不输出错误消息或堆栈跟踪(“[VERBOSE-2:dart_error.cc(16)]未处理的异常:”)

时间:2018-04-21 19:03:36

标签: dart flutter

在我的flutter应用程序的代码库中抛出异常。

然而,这是控制台输出的内容:

[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
// (nothing, should be printing stack-trace or error message here)

VERBOSE-2:dart_error.cc(16)

没有堆栈跟踪使得很难找到这个bug的来源。

有人知道堆栈跟踪或错误消息是否打印是否正常?

是否有一种模式可以运行flutter run以查看有关错误的更多信息?

设置:

flutter: 0.2.8
running on an iphone device

1 个答案:

答案 0 :(得分:1)

了解ios物理设备/抖动错误的一种见解是查看物理设备控制台和设备日志。就我而言,我正在使用iPhone 6S尝试在相机应用程序上工作。

可通过Xcode->窗口->设备和模拟器->选择设备来查看日志,然后选择“查看设备日志”或“打开控制台”按钮。选择“错误和错误”按钮可以使此操作更容易。

就我而言,我发现相机权限中的错误在我的开发环境中根本看不到。该应用程序刚刚崩溃,我不知道为什么...然后我在日志中找到了这个...

error   21:51:03.438135 -0700   tccd    Refusing TCCAccessRequest for service kTCCServiceCamera and client /var/containers/Bundle/Application/A817FC3E-F55D-46F5-9EF2-372E4FC90B1B/Runner.app[319] without NSCameraUsageDescription key
error   21:51:03.476854 -0700   Runner  This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

我在iPhone上遇到的相机困境的修复方法如下:

  • 找到Info.plist文件(位置= flutter_image_picker / ios / Runner / Info.plist)
  • 添加以下键/字符串对:

    <key>NSCameraUsageDescription</key>

    <string>Camera used to take photos in support of the app.</string>

所有固定!

相关问题