Reputation: 543
There is an exception throwing somewhere in the codebase of my flutter application.
However this is what the console output:
[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
// (nothing, should be printing stack-trace or error message here)
Not having the stack-trace makes it very hard to find where this bug is coming from.
Does anyone know if it is normal that the stack-trace or the error message does not print?
Is there a mode in which I should run flutter run
in order to see more information about the error being thrown?
Setup :
flutter: 0.2.8
running on an iphone device
Upvotes: 3
Views: 1974
Reputation: 4017
One insight to obtuse ios physical device / flutter errors is review the the physical device console and device logs. In my case, I'm using an iphone 6S trying to work on a camera app.
The logs are available via Xcode --> Window --> Devices and Simulators --> choose Devices, then select either "View Device Logs" or "Open Console" button. Select the button for "Errors and Faults" to make this a bit easier.
In my case I discovered an error in camera permissions that wasn't visible at all from my development environment. The app just crashed, I had no clue why... Then I found this in the log...
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.
The fix for my camera dilemma on the iPhone is as follows:
Add the following key/string pair:
<key>NSCameraUsageDescription</key>
<string>Camera used to take photos in support of the app.</string>
All fixed!
Upvotes: 2