Menu

1 / 2

Your Flutter desktop app won't start: one corrupt preferences file

DEV Community: dart·Frank Milvus·5 days ago
#MOvU4Axn
#devtodart#devto#dev#file#preferences
Reading 0:00
15s threshold

The report was short: the desktop build opens and closes immediately. No window, no error dialog, nothing to click. On the terminal, the process printed a stack trace and quit before anything appeared on screen.

The cause was not a broken build, a missing library, or a failed update. It was one settings file with a missing bracket.

This post is about that failure and the fix: how a single corrupt JSON file can stop a Flutter desktop app before its first frame, why wrapping the read in try/catch does not save you, and how the app now repairs itself at launch without throwing away the evidence.

A launch that dies before it can report anything

The terminal showed this:

Unhandled Exception: FormatException: Unexpected character (at character 31943) ...notif_suppressed_136":1793799452696}"flutter.keystore_durability_expecte...

Enter fullscreen mode

Exit fullscreen mode

Look closely at the quoted fragment. There is a closing } after a timestamp, and then another key starts immediately: …2696}"flutter… .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.